Skip to content

Commit

Permalink
ix(delayed_job): rename 'send' operation to 'publish'
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-kazmierczak committed Sep 5, 2023
1 parent 80e7e87 commit bd32c18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def instrument_enqueue(job, &block)
return block.call(job) unless enabled?

attributes = build_attributes(job)
attributes['messaging.operation'] = 'send'
attributes['messaging.operation'] = 'publish'
attributes.compact!

tracer.in_span("#{job_queue(job)} send", attributes: attributes, kind: :producer) do |span|
tracer.in_span("#{job_queue(job)} publish", attributes: attributes, kind: :producer) do |span|
yield job
span.set_attribute('messaging.message_id', job.id.to_s)
add_events(span, job)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def job_data
_(exporter.finished_spans.size).must_equal 1

_(span).must_be_kind_of OpenTelemetry::SDK::Trace::SpanData
_(span.name).must_equal 'default send'
_(span.name).must_equal 'default publish'
_(span.attributes['messaging.system']).must_equal 'delayed_job'
_(span.attributes['messaging.destination']).must_equal 'default'
_(span.attributes['messaging.destination_kind']).must_equal 'queue'
_(span.attributes['messaging.delayed_job.name']).must_equal 'BasicPayload'
_(span.attributes['messaging.delayed_job.priority']).must_equal 0
_(span.attributes['messaging.operation']).must_equal 'send'
_(span.attributes['messaging.operation']).must_equal 'publish'
_(span.attributes['messaging.message_id']).must_be_kind_of String

_(span.events.size).must_equal 2
Expand Down Expand Up @@ -122,7 +122,7 @@ def job_data
_(exporter.finished_spans).must_equal []
job_enqueue
_(exporter.finished_spans.size).must_equal 1
_(exporter.finished_spans.first.name).must_equal 'default send'
_(exporter.finished_spans.first.name).must_equal 'default publish'
job_run
_(exporter.finished_spans.size).must_equal 2

Expand Down

0 comments on commit bd32c18

Please sign in to comment.