Class: Instana::Activators::Sinatra
Instance Method Summary
collapse
#call, call, inherited, start
Instance Method Details
#can_instrument? ⇒ Boolean
7
8
9
|
# File 'lib/instana/activators/sinatra.rb', line 7
def can_instrument?
defined?(::Instana::Rack) && defined?(::Sinatra) && defined?(::Sinatra::Base) && !::Sinatra::Base.middleware.nil?
end
|
#instrument ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/instana/activators/sinatra.rb', line 11
def instrument
require 'instana/frameworks/sinatra'
::Sinatra::Base.use ::Instana::Rack
unless ::Sinatra::Base.respond_to?(:mustermann_opts)
::Sinatra::Base.set :mustermann_opts, {}
end
::Sinatra::Base.register ::Instana::SinatraPathTemplateExtractor
true
end
|