Module: Datadog::Tracing::Contrib::Kafka::Events::Connection::Request

Includes:
Datadog::Tracing::Contrib::Kafka::Event
Defined in:
lib/datadog/tracing/contrib/kafka/events/connection/request.rb

Overview

Defines instrumentation for request.connection.kafka event

Constant Summary collapse

EVENT_NAME =
'request.connection.kafka'.freeze

Class Method Summary collapse

Methods included from Datadog::Tracing::Contrib::Kafka::Event

included

Class Method Details

.process(span, _event, _id, payload) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/datadog/tracing/contrib/kafka/events/connection/request.rb', line 16

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

.span_nameObject



27
28
29
# File 'lib/datadog/tracing/contrib/kafka/events/connection/request.rb', line 27

def span_name
  Ext::SPAN_CONNECTION_REQUEST
end

.span_optionsObject



31
32
33
# File 'lib/datadog/tracing/contrib/kafka/events/connection/request.rb', line 31

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