Module: Datadog::Tracing::Contrib::Kafka::Events::ConsumerGroup::Heartbeat

Extended by:
ConsumerEvent, ConsumerGroupEvent
Includes:
Datadog::Tracing::Contrib::Kafka::Event
Defined in:
lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb

Overview

Defines instrumentation for heartbeat.consumer.kafka event

Constant Summary collapse

EVENT_NAME =
'heartbeat.consumer.kafka'.freeze

Class Method Summary collapse

Methods included from ConsumerEvent

process

Methods included from ConsumerGroupEvent

process

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

included

Class Method Details

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



20
21
22
23
24
25
26
27
28
# File 'lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb', line 20

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

  if payload.key?(:topic_partitions)
    payload[:topic_partitions].each do |topic, partitions|
      span.set_tag("#{Ext::TAG_TOPIC_PARTITIONS}.#{topic}", partitions)
    end
  end
end

.span_nameObject



32
33
34
# File 'lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb', line 32

def span_name
  Ext::SPAN_CONSUMER_HEARTBEAT
end

.span_optionsObject



36
37
38
# File 'lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb', line 36

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