Sha256: b91a2243a0b84fe77ade789c4d44cb5cd9b14f32c600d35159c1e987f851af3f

Contents?: true

Size: 794 Bytes

Versions: 15

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module Instrumentation
    module Net
      module HTTP
        # The Instrumentation class contains logic to detect and install the Net::HTTP
        # instrumentation
        class Instrumentation < OpenTelemetry::Instrumentation::Base
          install do |_config|
            require_dependencies
            patch
          end

          present do
            defined?(::Net::HTTP)
          end

          private

          def require_dependencies
            require_relative 'patches/instrumentation'
          end

          def patch
            ::Net::HTTP.prepend(Patches::Instrumentation)
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-net_http-0.20.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.5 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.4 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.3 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.2 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.1 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.19.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.18.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.17.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.16.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.15.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.14.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.13.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.12.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb
opentelemetry-instrumentation-net_http-0.11.0 lib/opentelemetry/instrumentation/net/http/instrumentation.rb