Module: Datadog::Tracing::Contrib::Kafka::Events::ProduceOperation::SendMessages

Includes:
Datadog::Tracing::Contrib::Kafka::Event
Defined in:
lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb

Overview

Defines instrumentation for send_messages.producer.kafka event

Constant Summary collapse

EVENT_NAME =
'send_messages.producer.kafka'.freeze

Class Method Summary collapse

Methods included from Datadog::Tracing::Contrib::Kafka::Event

included

Class Method Details

.process(span, _event, _id, payload) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb', line 16

def self.process(span, _event, _id, payload)
  super

  span.set_tag(Ext::TAG_MESSAGE_COUNT, payload[:message_count]) if payload.key?(:message_count)
  span.set_tag(Ext::TAG_SENT_MESSAGE_COUNT, payload[:sent_message_count]) if payload.key?(:sent_message_count)
  span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_PRODUCER)
end

.span_nameObject



26
27
28
# File 'lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb', line 26

def span_name
  Ext::SPAN_SEND_MESSAGES
end

.span_optionsObject



30
31
32
# File 'lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb', line 30

def span_options
  super.merge({ tags: { Tracing::Metadata::Ext::TAG_OPERATION => Ext::TAG_OPERATION_SEND_MESSAGES } })
end