Sha256: 6d376633e6a48f6eabf7bd7f92c892db1e65486d734d08869d421dba0413501e

Contents?: true

Size: 1.11 KB

Versions: 52

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'new_relic/agent/instrumentation/sinatra'

DependencyDetection.defer do
  @name = :padrino

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

  executes do
    ::NewRelic::Agent.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 NewRelic::Agent::Instrumentation::Sinatra

      alias dispatch_without_newrelic dispatch!
      alias dispatch! dispatch_with_newrelic
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
newrelic_rpm-3.15.1.316 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.15.0.314 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.14.3.313 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.14.2.312 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.14.1.311 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.14.0.305 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.13.2.302 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.13.1.300 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.13.0.299 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.12.1.298 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.12.0.288 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.11.2.286 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.11.1.284 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.11.0.283 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.10.0.279 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.9.9.275 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.9.8.273 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.9.7.266 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.9.6.257 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-3.9.5.251 lib/new_relic/agent/instrumentation/padrino.rb