Class: NewRelic::Agent::Instrumentation::Sidekiq::Client

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::ClientMiddleware
Defined in:
lib/new_relic/agent/instrumentation/sidekiq/client.rb

Constant Summary collapse

INSTRUMENTATION_NAME =
'SidekiqClient'

Instance Method Summary collapse

Instance Method Details

#call(_worker_class, job, *_) ⇒ Object



11
12
13
14
15
16
# File 'lib/new_relic/agent/instrumentation/sidekiq/client.rb', line 11

def call(_worker_class, job, *_)
  NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)

  job[NewRelic::NEWRELIC_KEY] ||= distributed_tracing_headers if ::NewRelic::Agent.config[:'distributed_tracing.enabled']
  yield
end

#distributed_tracing_headersObject



18
19
20
21
22
# File 'lib/new_relic/agent/instrumentation/sidekiq/client.rb', line 18

def distributed_tracing_headers
  headers = {}
  ::NewRelic::Agent::DistributedTracing.insert_distributed_trace_headers(headers)
  headers
end