Sha256: a1551d1b9b8b4049fca83d1f1eede1dd01eee3ae599177f852e2182feb078100

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

# typed: true

require_relative '../../ext'
require_relative '../../event'

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ddtrace-1.6.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb