Module: OpenTelemetry::Instrumentation::RubyKafka::Patches::Producer
- Defined in:
- lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb
Overview
The Producer module contains the instrumentation patch the Producer#produce method
Instance Method Summary collapse
Instance Method Details
#produce(value, key: nil, headers: {}, topic:, partition: nil, partition_key: nil, create_time: Time.now) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb', line 13 def produce(value, key: nil, headers: {}, topic:, partition: nil, partition_key: nil, create_time: Time.now) attributes = { 'messaging.system' => 'kafka', 'messaging.destination' => topic, 'messaging.destination_kind' => 'topic' } tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do OpenTelemetry.propagation.inject(headers) super end end |