Module: Datadog::Tracing::Contrib::Kafka::Events::Producer::DeliverMessages

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

Overview

Defines instrumentation for deliver_messages.producer.kafka event

Constant Summary collapse

EVENT_NAME =
'deliver_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
23
24
25
# File 'lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb', line 16

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

  span.set_tag(Ext::TAG_ATTEMPTS, payload[:attempts]) if payload.key?(:attempts)
  span.set_tag(Ext::TAG_MESSAGE_COUNT, payload[:message_count]) if payload.key?(:message_count)
  if payload.key?(:delivered_message_count)
    span.set_tag(Ext::TAG_DELIVERED_MESSAGE_COUNT, payload[:delivered_message_count])
  end
  span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_PRODUCER)
end

.span_nameObject



29
30
31
# File 'lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb', line 29

def span_name
  Ext::SPAN_DELIVER_MESSAGES
end

.span_optionsObject



33
34
35
# File 'lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb', line 33

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