Class: Funktor::Middleware::NewRelic

Inherits:
Object
  • Object
show all
Includes:
NewRelic::Agent::Instrumentation::ControllerInstrumentation
Defined in:
lib/funktor/middleware/new_relic.rb

Instance Method Summary collapse

Instance Method Details

#call(job) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/funktor/middleware/new_relic.rb', line 12

def call(job)
  ::NewRelic::Agent.manual_start(:sync_startup => true)
  trace_args = {
    :name => 'perform',
    :class_name => job.worker_class_name_for_metrics,
    :category => 'OtherTransaction/Funktor'
  }
  perform_action_with_newrelic_trace(trace_args) do
    ::NewRelic::Agent::Transaction.merge_untrusted_agent_attributes(job.worker_params,
                                                                  :'worker.funktor.params',
                                                                  ::NewRelic::Agent::AttributeFilter::DST_NONE)
    yield
  end
  ::NewRelic::Agent.shutdown
end