Sha256: 694ac51209f7eccecdcdb26060e7ae29d4ee84933204925447866380d0685aba

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

require 'ddtrace/contrib/kafka/ext'
require 'ddtrace/contrib/kafka/event'
require 'ddtrace/contrib/kafka/consumer_event'
require 'ddtrace/contrib/kafka/consumer_group_event'

module Datadog
  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
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.51.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.50.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.49.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.48.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.47.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.46.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.45.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.44.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.43.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.42.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.41.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ls-trace-0.2.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.40.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.39.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb
ddtrace-0.38.0 lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb