Skip to content

Commit

Permalink
use sqs_msg.message_attributes for context propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcinbell committed Nov 3, 2023
1 parent 5acdbf0 commit 2292f62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2292f62

Please sign in to comment.