Sha256: beaeaf7ba1363f8d1bf6bf7feb8a7bbc0106ce27d44bed729211c9e8a1301906

Contents?: true

Size: 640 Bytes

Versions: 12

Compression:

Stored size: 640 Bytes

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021

module Instana
  module Activators
    class Sinatra < Activator
      def can_instrument?
        defined?(::Instana::Rack) && defined?(::Sinatra) && defined?(::Sinatra::Base) && !::Sinatra::Base.middleware.nil?
      end

      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
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
instana-1.217.1 lib/instana/activators/sinatra.rb
instana-1.217.0 lib/instana/activators/sinatra.rb
instana-1.216.0 lib/instana/activators/sinatra.rb
instana-1.215.1 lib/instana/activators/sinatra.rb
instana-1.215.0 lib/instana/activators/sinatra.rb
instana-1.214.4 lib/instana/activators/sinatra.rb
instana-1.214.3 lib/instana/activators/sinatra.rb
instana-1.214.2 lib/instana/activators/sinatra.rb
instana-1.214.1 lib/instana/activators/sinatra.rb
instana-1.214.0 lib/instana/activators/sinatra.rb
instana-1.213.3 lib/instana/activators/sinatra.rb
instana-1.213.2 lib/instana/activators/sinatra.rb