Sha256: 3e643329f535602219421618f70e7250b675d9de87549cb6a6de01ec014f0ff5

Contents?: true

Size: 1.32 KB

Versions: 12

Compression:

Stored size: 1.32 KB

Contents

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

require_relative 'roda/instrumentation'
require_relative 'roda/roda_transaction_namer'
require_relative 'roda/ignorer'

DependencyDetection.defer do
  named :roda

  depends_on do
    defined?(Roda) &&
      Gem::Version.new(Roda::RodaVersion) >= Gem::Version.new('3.19.0') &&
      Roda::RodaPlugins::Base::ClassMethods.private_method_defined?(:build_rack_app) &&
      Roda::RodaPlugins::Base::InstanceMethods.method_defined?(:_roda_handle_main_route)
  end

  executes do
    require_relative '../../rack/agent_hooks'
    require_relative '../../rack/browser_monitoring'

    NewRelic::Agent.logger.info('Installing Roda instrumentation')

    if use_prepend?
      require_relative 'roda/prepend'
      prepend_instrument Roda.singleton_class, NewRelic::Agent::Instrumentation::Roda::Build::Prepend
      prepend_instrument Roda, NewRelic::Agent::Instrumentation::Roda::Prepend
    else
      require_relative 'roda/chain'
      chain_instrument NewRelic::Agent::Instrumentation::Roda::Build::Chain
      chain_instrument NewRelic::Agent::Instrumentation::Roda::Chain
    end
    Roda.class_eval { extend NewRelic::Agent::Instrumentation::Roda::Ignorer }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/roda.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/roda.rb