lib/opentelemetry/instrumentation/que/patches/que_job.rb in opentelemetry-instrumentation-que-0.6.2 vs lib/opentelemetry/instrumentation/que/patches/que_job.rb in opentelemetry-instrumentation-que-0.7.0

- old
+ new

@@ -20,11 +20,11 @@ module ClassMethods def enqueue(*args, job_options: {}, **arg_opts) tracer = Que::Instrumentation.instance.tracer otel_config = Que::Instrumentation.instance.config - tracer.in_span('send', kind: :producer) do |span| + tracer.in_span('publish', kind: :producer) do |span| # Que doesn't have a good place to store metadata. There are # basically two options: the job payload and the job tags. # # Using the job payload is very brittle. We'd have to modify # existing Hash arguments or add a new argument when there are @@ -55,11 +55,11 @@ else job = super(*args, job_options: job_options.merge(tags: tags), **arg_opts) job_attrs = job.que_attrs end - span.name = "#{job_attrs[:job_class]} send" + span.name = "#{job_attrs[:job_class]} publish" span.add_attributes(QueJob.job_attributes(job_attrs)) job end end @@ -71,10 +71,10 @@ def self.job_attributes(job_attrs) attributes = { 'messaging.system' => 'que', 'messaging.destination_kind' => 'queue', - 'messaging.operation' => 'send', + 'messaging.operation' => 'publish', 'messaging.destination' => job_attrs[:queue] || 'default', 'messaging.que.job_class' => job_attrs[:job_class], 'messaging.que.priority' => job_attrs[:priority] || 100 } attributes['messaging.message_id'] = job_attrs[:id] if job_attrs[:id]