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'

Class Method Summary collapse

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

included

Class Method Details

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



20
21
22
23
24
25
26
27
# File 'lib/datadog/tracing/contrib/kafka/events/connection/request.rb', line 20

def on_start(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



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

def span_name
  Ext::SPAN_CONNECTION_REQUEST
end

.span_optionsObject



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

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