Module: OpenTelemetry::Instrumentation::HTTP::Patches::Connection

Defined in:
lib/opentelemetry/instrumentation/http/patches/connection.rb

Overview

Module to prepend to HTTP::Connection for instrumentation

Instance Method Summary collapse

Instance Method Details

#initialize(req, options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/opentelemetry/instrumentation/http/patches/connection.rb', line 13

def initialize(req, options)
  attributes = {
    'net.peer.name' => req.uri.host,
    'net.peer.port' => req.uri.port
  }.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)

  tracer.in_span('HTTP CONNECT', attributes: attributes) do
    super
  end
end