diff --git a/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware.rb b/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware.rb index 02105564b..039390a8f 100644 --- a/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware.rb +++ b/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware.rb @@ -25,8 +25,8 @@ def call(_worker_class, job, _queue, _redis_pool) attributes[SemanticConventions::Trace::PEER_SERVICE] = instrumentation_config[:peer_service] if instrumentation_config[:peer_service] span_name = case instrumentation_config[:span_naming] - when :job_class then "#{job['wrapped']&.to_s || job['class']} send" - else "#{job['queue']} send" + when :job_class then "#{job['wrapped']&.to_s || job['class']} publish" + else "#{job['queue']} publish" end tracer.in_span(span_name, attributes: attributes, kind: :producer) do |span| diff --git a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware_test.rb b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware_test.rb index b76c490c4..a2de3d05d 100644 --- a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware_test.rb +++ b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware_test.rb @@ -35,7 +35,7 @@ _(exporter.finished_spans.size).must_equal 1 - _(enqueue_span.name).must_equal 'default send' + _(enqueue_span.name).must_equal 'default publish' _(enqueue_span.kind).must_equal :producer _(enqueue_span.parent_span_id).must_equal OpenTelemetry::Trace::INVALID_SPAN_ID _(enqueue_span.attributes['messaging.system']).must_equal 'sidekiq' @@ -49,7 +49,7 @@ it 'traces when enqueued with Active Job' do SimpleJobWithActiveJob.perform_later(1, 2) - _(enqueue_span.name).must_equal('default send') + _(enqueue_span.name).must_equal('default publish') _(enqueue_span.attributes['messaging.system']).must_equal('sidekiq') _(enqueue_span.attributes['messaging.sidekiq.job_class']).must_equal('SimpleJobWithActiveJob') _(enqueue_span.attributes['messaging.destination']).must_equal('default') @@ -62,12 +62,12 @@ it 'uses the job class name for the span name' do SimpleJob.perform_async - _(enqueue_span.name).must_equal('SimpleJob send') + _(enqueue_span.name).must_equal('SimpleJob publish') end it 'uses the job class name when enqueued with Active Job' do SimpleJobWithActiveJob.perform_later(1, 2) - _(enqueue_span.name).must_equal('SimpleJobWithActiveJob send') + _(enqueue_span.name).must_equal('SimpleJobWithActiveJob publish') end end diff --git a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware_test.rb b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware_test.rb index 716ca8373..145d3b743 100644 --- a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware_test.rb +++ b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware_test.rb @@ -123,7 +123,7 @@ # root job that enqueues another job _(root_span.parent_span_id).must_equal OpenTelemetry::Trace::INVALID_SPAN_ID - _(root_span.name).must_equal 'default send' + _(root_span.name).must_equal 'default publish' _(root_span.kind).must_equal :producer # process span is linked to the root enqueuing job @@ -133,7 +133,7 @@ # enquene span is child to the parent process job child_span2 = spans.find { |s| s.parent_span_id == child_span1.span_id } - _(child_span2.name).must_equal 'default send' + _(child_span2.name).must_equal 'default publish' _(child_span2.kind).must_equal :producer # last process job is linked back to the process job that enqueued it @@ -182,7 +182,7 @@ _(exporter.finished_spans.size).must_equal 4 _(root_span.parent_span_id).must_equal OpenTelemetry::Trace::INVALID_SPAN_ID - _(root_span.name).must_equal 'default send' + _(root_span.name).must_equal 'default publish' _(root_span.kind).must_equal :producer child_span1 = spans.find { |s| s.parent_span_id == root_span.span_id } @@ -190,7 +190,7 @@ _(child_span1.kind).must_equal :consumer child_span2 = spans.find { |s| s.parent_span_id == child_span1.span_id } - _(child_span2.name).must_equal 'default send' + _(child_span2.name).must_equal 'default publish' _(child_span2.kind).must_equal :producer child_span3 = spans.find { |s| s.parent_span_id == child_span2.span_id }