Sha256: 438ddd54ad7675e2c72cdd6814f40953ef7c860c365379d98d2b165cf4910a92

Contents?: true

Size: 861 Bytes

Versions: 14

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

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

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

        present do
          defined?(::Excon)
        end

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

        private

        def require_dependencies
          require_relative 'middlewares/tracer_middleware'
        end

        def add_middleware
          ::Excon.defaults[:middlewares] =
            Middlewares::TracerMiddleware.around_default_stack
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-excon-0.21.3 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.21.2 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.21.1 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.21.0 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.20.1 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.20.0 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.5 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.4 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.3 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.2 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.1 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.19.0 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.18.0 lib/opentelemetry/instrumentation/excon/instrumentation.rb
opentelemetry-instrumentation-excon-0.17.0 lib/opentelemetry/instrumentation/excon/instrumentation.rb