Sha256: c44706ecf0f523b88c87c1f8cbb40b13f8586d5bfb61e0f2247174c290b0426a

Contents?: true

Size: 925 Bytes

Versions: 7

Compression:

Stored size: 925 Bytes

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.

module NewRelic::Agent::Instrumentation
  module Padrino
    def invoke_route_with_tracing(*args)
      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

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-8.9.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.8.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.7.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.6.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.5.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.4.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb
newrelic_rpm-8.3.0 lib/new_relic/agent/instrumentation/padrino/instrumentation.rb