lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb in opentelemetry-instrumentation-sidekiq-0.23.0 vs lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb in opentelemetry-instrumentation-sidekiq-0.24.0

- old
+ new

@@ -12,17 +12,17 @@ # TracerMiddleware propagates context and instruments Sidekiq requests # by way of its middleware system class TracerMiddleware def call(_worker, msg, _queue) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity attributes = { - 'messaging.system' => 'sidekiq', + SemanticConventions::Trace::MESSAGING_SYSTEM => 'sidekiq', 'messaging.sidekiq.job_class' => msg['wrapped']&.to_s || msg['class'], - 'messaging.message_id' => msg['jid'], - 'messaging.destination' => msg['queue'], - 'messaging.destination_kind' => 'queue', - 'messaging.operation' => 'process' + SemanticConventions::Trace::MESSAGING_MESSAGE_ID => msg['jid'], + SemanticConventions::Trace::MESSAGING_DESTINATION => msg['queue'], + SemanticConventions::Trace::MESSAGING_DESTINATION_KIND => 'queue', + SemanticConventions::Trace::MESSAGING_OPERATION => 'process' } - attributes['peer.service'] = instrumentation_config[:peer_service] if instrumentation_config[:peer_service] + 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 "#{msg['wrapped']&.to_s || msg['class']} process" else "#{msg['queue']} process" end