Module: NewRelic::Agent::Instrumentation::Rack::URLMap::Chain

Defined in:
lib/new_relic/agent/instrumentation/rack/chain.rb

Class Method Summary collapse

Class Method Details

.instrument!(url_map_class) ⇒ Object



53
54
55
56
57
58
59
60
61
62
# File 'lib/new_relic/agent/instrumentation/rack/chain.rb', line 53

def self.instrument!(url_map_class)
  url_map_class.class_eval do
    alias_method(:initialize_without_newrelic, :initialize)

    def initialize(map = {})
      traced_map = ::NewRelic::Agent::Instrumentation::RackURLMap.generate_traced_map(map)
      initialize_without_newrelic(traced_map)
    end
  end
end