Sha256: e145f9b62bf48f130e414709e34e8dce01f3b0bcd0f96c8ba966f513ccda3076

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

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

# 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.

require_relative 'sinatra'
require_relative 'padrino/chain'
require_relative 'padrino/instrumentation'
require_relative 'padrino/prepend'

DependencyDetection.defer do
  @name = :padrino
  configure_with :sinatra

  depends_on { defined?(::Padrino) && defined?(::Padrino::Routing::InstanceMethods) }

  executes do
    ::NewRelic::Agent.logger.info 'Installing Padrino instrumentation'
    if use_prepend?
      prepend_instrument ::Padrino::Routing::InstanceMethods, NewRelic::Agent::Instrumentation::Padrino::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Padrino::Chain
    end
  end
end



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-8.0.0 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-7.2.0 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-7.1.0 lib/new_relic/agent/instrumentation/padrino.rb
newrelic_rpm-7.0.0 lib/new_relic/agent/instrumentation/padrino.rb