Class: Sidekiq::Extensions::DelayedClass

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb

Instance Method Summary collapse

Instance Method Details

#newrelic_trace_args(msg, queue) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/new_relic/agent/instrumentation/sidekiq/extensions/delayed_class.rb', line 13

def newrelic_trace_args(msg, queue)
  (target, method_name, _args) = if YAML.respond_to?(:unsafe_load)
    YAML.unsafe_load(msg['args'][0])
  else
    YAML.load(msg['args'][0])
  end

  {
    :name => method_name,
    :class_name => target.name,
    :category => 'OtherTransaction/SidekiqJob'
  }
rescue => e
  NewRelic::Agent.logger.error('Failure during deserializing YAML for Sidekiq::Extensions::DelayedClass', e)
  NewRelic::Agent::Instrumentation::Sidekiq::Server.default_trace_args(msg)
end