lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb in opentelemetry-instrumentation-ruby_kafka-0.12.0 vs lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb in opentelemetry-instrumentation-ruby_kafka-0.13.0
- old
+ new
@@ -36,11 +36,13 @@
}
attributes['messaging.kafka.message_key'] = message.key if message.key
parent_context = OpenTelemetry.propagation.text.extract(message.headers)
- tracer.in_span("#{topic} process", with_parent: parent_context, attributes: attributes, kind: :consumer) do
- yield message
+ OpenTelemetry::Context.with_current(parent_context) do
+ tracer.in_span("#{topic} process", attributes: attributes, kind: :consumer) do
+ yield message
+ end
end
end
end
private