Sha256: e5d30981983db6d59b5261ac1b473ec0e3f0b10f34c7c2b081d640b93ddca772

Contents?: true

Size: 881 Bytes

Versions: 16

Compression:

Stored size: 881 Bytes

Contents

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

module Datadog
  module Contrib
    module Kafka
      module Events
        module Connection
          # Defines instrumentation for request.connection.kafka event
          module Request
            include Kafka::Event

            EVENT_NAME = 'request.connection.kafka'.freeze

            def self.process(span, _event, _id, payload)
              super

              span.resource = payload[:api]

              span.set_tag(Ext::TAG_REQUEST_SIZE, payload[:request_size]) if payload.key?(:request_size)
              span.set_tag(Ext::TAG_RESPONSE_SIZE, payload[:response_size]) if payload.key?(:response_size)
            end

            module_function

            def span_name
              Ext::SPAN_CONNECTION_REQUEST
            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/connection/request.rb
ddtrace-0.51.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.50.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.49.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.48.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.47.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.46.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.45.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.44.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.43.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.42.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.41.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ls-trace-0.2.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.40.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.39.0 lib/ddtrace/contrib/kafka/events/connection/request.rb
ddtrace-0.38.0 lib/ddtrace/contrib/kafka/events/connection/request.rb