Sha256: 4e995a862e13673a8fc10f16d5ebbab7a937b454f2cef49e61df3cbf1faea7dd

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

Contents

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)
                span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_PRODUCER)
              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

24 entries across 24 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.19.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.18.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.17.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.16.2 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.16.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.16.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.15.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.14.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.13.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.13.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.12.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb