Sha256: a26c5c7ae0e4d3a9eabc5a681e18404a20fbac71c8aa2211d9138d279afe22a4

Contents?: true

Size: 1.05 KB

Versions: 15

Compression:

Stored size: 1.05 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

module NewRelic::Agent::Instrumentation
  module Padrino
    INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)

    def invoke_route_with_tracing(*args)
      NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)

      begin
        env['newrelic.last_route'] = args[0].original_path
      rescue => e
        ::NewRelic::Agent.logger.debug('Failed determining last route in Padrino', e)
      end

      begin
        txn_name = ::NewRelic::Agent::Instrumentation::Sinatra::TransactionNamer.transaction_name_for_route(env, request)
        unless txn_name.nil?
          ::NewRelic::Agent::Transaction.set_default_transaction_name(
            "#{self.class.name}/#{txn_name}", :sinatra
          )
        end
      rescue => e
        ::NewRelic::Agent.logger.debug('Failed during invoke_route to set transaction name', e)
      end

      yield
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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