diff --git a/instrumentation/shoryuken/lib/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware.rb b/instrumentation/shoryuken/lib/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware.rb index 59ca01421..69ca77350 100644 --- a/instrumentation/shoryuken/lib/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware.rb +++ b/instrumentation/shoryuken/lib/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware.rb @@ -22,7 +22,7 @@ def call(worker_instance, queue, sqs_msg, _body) else "#{queue} process" end - extracted_context = OpenTelemetry.propagation.extract(sqs_msg) + extracted_context = OpenTelemetry.propagation.extract(sqs_msg.message_attributes) OpenTelemetry::Context.with_current(extracted_context) do links = [] span_context = OpenTelemetry::Trace.current_span(extracted_context).context diff --git a/instrumentation/shoryuken/test/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware_test.rb b/instrumentation/shoryuken/test/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware_test.rb index 921ef25eb..fbea1e411 100644 --- a/instrumentation/shoryuken/test/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware_test.rb +++ b/instrumentation/shoryuken/test/opentelemetry/instrumentation/shoryuken/middlewares/server/tracer_middleware_test.rb @@ -34,8 +34,6 @@ before do allow(sqs_client).to receive(:get_queue_url).and_return(double(queue_url: 'https://sqs.fake.amazonaws.com/1/queue-name')) - allow(sqs_msg).to receive(:[]).with('baggage') - allow(sqs_msg).to receive(:[]).with('traceparent') instrumentation.install(config) exporter.reset Shoryuken::Client.sqs = sqs_client