12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/instrumentation/epsagon_resque_job.rb', line 12
def push(queue, item)
epsagon_conf = config[:epsagon] || {}
job_class = if item[:class] == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && item[:args][0]&.is_a?(Hash)
item[:args][0]['job_class']
else
item[:class]
end
attributes = {
'operation' => 'enqueue',
'messaging.system' => 'resque',
'messaging.resque.job_class' => job_class,
'messaging.destination' => queue.to_s,
'messaging.destination_kind' => 'queue',
'messaging.resque.redis_url' => Resque.redis.connection[:id]
}
unless epsagon_conf[:metadata_only]
attributes.merge!({
'messaging.resque.args' => item
})
end
tracer.in_span(queue.to_s, attributes: attributes, kind: :producer) do
OpenTelemetry.propagation.text.inject(item)
super
end
end
|