Sha256: 9e5682a87a0212ac0d9339a3566aef744a424154bd8e53e8d2b69e65dc70261d

Contents?: true

Size: 759 Bytes

Versions: 12

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module HttpClient
      module Patches
        # Module to prepend to HTTPClient::Session for instrumentation
        module Session
          def connect
            site = @proxy || @dest
            url = site.addr

            attributes = { 'http.url' => url }.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
            tracer.in_span('HTTP CONNECT', attributes: attributes) do
              super
            end
          end

          private

          def tracer
            HttpClient::Instrumentation.instance.tracer
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-http_client-0.22.8 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.7 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.6 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.4 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.3 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.2 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.1 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.22.0 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.21.0 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.20.0 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.19.5 lib/opentelemetry/instrumentation/http_client/patches/session.rb
opentelemetry-instrumentation-http_client-0.19.4 lib/opentelemetry/instrumentation/http_client/patches/session.rb