No release in over 3 years
Low commit activity in last 3 years
OpenTracing compatible auto-instrumentation for Sinatra web applications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2
~> 2.1
~> 1.1
~> 10.0
~> 3.0
~> 0.60
~> 1.30.0
~> 1.4

Runtime

 Project Readme

Sinatra::Instrumentation

Auto-instrumenter for Sinatra applications. It traces routes using Rack::Tracer and patches Sinatra to trace template rendering.

Supported Versions

  • MRI Ruby 2.0 and newer
  • Sinatra 1.1.4 and newer

Installation

Add this line to your application's Gemfile:

gem 'sinatra-instrumentation'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sinatra-instrumentation

Usage

In a classic Sinatra application, this can be used by requiring the library:

require 'sinatra/instrumentation'

A modular application will need to register it manually:

class SinatraApp < Sinatra::Base
    register Sinatra::Instrumentation
    ...
end

Tags

In addition to the standard OpenTracing tags, the instrumentation also adds:

  • sinatra.template: the name of the view template, or if rendering a string with view code, the contents of the string.

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/signalfx/ruby-sinatra-instrumentation.

License

The gem is available as open source under the terms of the Apache 2.0 License.