From 6dc0a55af569a3f90332801d2a3ff0b8fd87b5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Rutkowski?= Date: Tue, 5 Sep 2023 16:42:20 +0200 Subject: [PATCH] fix: access rdkafka message headers with strings instead of symbols --- .../opentelemetry/instrumentation/rdkafka/patches/consumer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb index 97f3dd2b5..02133f213 100644 --- a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb +++ b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb @@ -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? @@ -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