Sha256: d03d142d1983fdb5908563f4903eac2e29f77575db57bf38d878ce73a6ee3f5c

Contents?: true

Size: 978 Bytes

Versions: 39

Compression:

Stored size: 978 Bytes

Contents

# encoding: utf-8

require 'one_apm/inst/framework/sinatra'

LibraryDetection.defer do
  @name = :padrino

  depends_on do
    !OneApm::Manager.config[:disable_sinatra] &&
      defined?(::Padrino) && defined?(::Padrino::Routing::InstanceMethods)
  end

  executes do
    OneApm::Manager.logger.info 'Installing Padrino instrumentation'

    # Our Padrino instrumentation relies heavily on the fact that Padrino is
    # built on Sinatra. Although it wires up a lot of its own routing logic,
    # we only need to patch into Padrino's dispatch to get things started.
    #
    # Parts of the Sinatra instrumentation (such as the TransactionNamer) are
    # aware of Padrino as a potential target in areas where both Sinatra and
    # Padrino run through the same code.
    module ::Padrino::Routing::InstanceMethods
      include OneApm::Agent::Instrumentation::Sinatra

      alias dispatch_without_oneapm dispatch!
      alias dispatch! dispatch_with_oneapm
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
oneapm_rpm-1.4.2 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.4.1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.4.0 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.7 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.7.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.6 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.6.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.5 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.5.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.4 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.4.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.3 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.3.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.2 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.2.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.1.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.0 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.3.0.rc1 lib/one_apm/inst/framework/padrino.rb
oneapm_rpm-1.2.9 lib/one_apm/inst/framework/padrino.rb