lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb in opentelemetry-instrumentation-ruby_kafka-0.13.0 vs lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb in opentelemetry-instrumentation-ruby_kafka-0.14.0
- old
+ new
@@ -19,11 +19,11 @@
attributes['messaging.kafka.message_key'] = key if key
attributes['messaging.kafka.partition'] = partition if partition
tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do
- OpenTelemetry.propagation.text.inject(headers)
+ OpenTelemetry.propagation.inject(headers)
super
end
end
def each_message(topic:, start_from_beginning: true, max_wait_time: 5, min_bytes: 1, max_bytes: 1_048_576, &block)
@@ -35,10 +35,10 @@
'messaging.kafka.partition' => message.partition
}
attributes['messaging.kafka.message_key'] = message.key if message.key
- parent_context = OpenTelemetry.propagation.text.extract(message.headers)
+ parent_context = OpenTelemetry.propagation.extract(message.headers)
OpenTelemetry::Context.with_current(parent_context) do
tracer.in_span("#{topic} process", attributes: attributes, kind: :consumer) do
yield message
end
end