Sha256: e10af7abed3a167abe8772db42a0f21ec5a7b858b4a532e6cd2404f96550d6ab

Contents?: true

Size: 1.26 KB

Versions: 12

Compression:

Stored size: 1.26 KB

Contents

# typed: true

require_relative '../../ext'
require_relative '../../event'
require_relative '../../consumer_event'
require_relative '../../consumer_group_event'

module Datadog
  module Tracing
    module Contrib
      module Kafka
        module Events
          module ConsumerGroup
            # Defines instrumentation for heartbeat.consumer.kafka event
            module Heartbeat
              include Kafka::Event
              extend Kafka::ConsumerEvent
              extend Kafka::ConsumerGroupEvent

              EVENT_NAME = 'heartbeat.consumer.kafka'.freeze

              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

              module_function

              def span_name
                Ext::SPAN_CONSUMER_HEARTBEAT
              end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.8.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.7.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.6.1 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb