Method: RPMContrib::Instrumentation::Camping.included

Defined in:
lib/rpm_contrib/instrumentation/camping.rb

.included(mod) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rpm_contrib/instrumentation/camping.rb', line 35

def self.included(mod)
  require 'new_relic/agent/instrumentation/controller_instrumentation'
  # Since the Camping::Base module is essentially copied
  # into the main module (the mod passed in) of a Camping app
  # using the Camping.goes :NewRelicCampingTest syntax
  # we need to evaluate "weld" the NewRelic plugin in the context of the new Base

  (Kernel.const_get(mod.name)::Base).module_eval do
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation
    add_transaction_tracer :service
  end
end