Sha256: 7410df43704734f623153e8abc10966ecf386ce60700813654fbe2e1730dcaa3

Contents?: true

Size: 877 Bytes

Versions: 20

Compression:

Stored size: 877 Bytes

Contents

# frozen_string_literal: true

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

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

        present do
          defined?(::Ethon::Easy)
        end

        option :peer_service, default: nil, validate: :string

        private

        def require_dependencies
          require_relative 'patches/easy'
          require_relative 'patches/multi'
        end

        def add_patches
          ::Ethon::Easy.prepend(Patches::Easy)
          ::Ethon::Multi.prepend(Patches::Multi)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-ethon-0.22.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.9 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.8 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.7 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.6 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.4 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.3 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.2 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.1 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.21.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.20.1 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.20.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.5 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.4 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.3 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.2 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.1 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.19.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.18.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb
opentelemetry-instrumentation-ethon-0.17.0 lib/opentelemetry/instrumentation/ethon/instrumentation.rb