Skip to content

Commit

Permalink
fix: access rdkafka message headers with strings instead of symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruto8 authored and Paweł Rutkowski committed Sep 6, 2023
1 parent d5b59e0 commit 6dc0a55
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def each
message_key = extract_message_key(message.key)
attributes['messaging.kafka.message_key'] = message_key if message_key

parent_context = OpenTelemetry.propagation.extract(message.headers, getter: OpenTelemetry::Common::Propagation.symbol_key_getter)
parent_context = OpenTelemetry.propagation.extract(message.headers)
span_context = OpenTelemetry::Trace.current_span(parent_context).context
links = [OpenTelemetry::Trace::Link.new(span_context)] if span_context.valid?

Expand All @@ -47,7 +47,7 @@ def each_batch(max_items: 100, bytes_threshold: Float::INFINITY, timeout_ms: 250
}

links = messages.map do |message|
trace_context = OpenTelemetry.propagation.extract(message.headers, getter: OpenTelemetry::Common::Propagation.symbol_key_getter)
trace_context = OpenTelemetry.propagation.extract(message.headers)
span_context = OpenTelemetry::Trace.current_span(trace_context).context
OpenTelemetry::Trace::Link.new(span_context) if span_context.valid?
end
Expand Down

0 comments on commit 6dc0a55

Please sign in to comment.