Sha256: 2419014c70c57525aceb7a87e545313e202e2d48fe7997339add5bbcd08903c5

Contents?: true

Size: 882 Bytes

Versions: 5

Compression:

Stored size: 882 Bytes

Contents

# typed: true
require 'ddtrace/contrib/kafka/ext'
require 'ddtrace/contrib/kafka/event'

module Datadog
  module Contrib
    module Kafka
      module Events
        module ProduceOperation
          # Defines instrumentation for send_messages.producer.kafka event
          module SendMessages
            include Kafka::Event

            EVENT_NAME = 'send_messages.producer.kafka'.freeze

            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)
            end

            module_function

            def span_name
              Ext::SPAN_SEND_MESSAGES
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-0.54.1 lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-0.54.0 lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-0.53.0 lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-0.52.0 lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb