Sha256: deb900d3ed8826b32d3a285fd3e71c0adb82827dfdfb76c63070f31d52002baa

Contents?: true

Size: 812 Bytes

Versions: 18

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

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

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

        present do
          defined?(::RestClient)
        end

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

        private

        def require_dependencies
          require_relative 'patches/request'
        end

        def patch_request
          ::RestClient::Request.prepend(Patches::Request)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-restclient-0.23.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.8 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.7 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.6 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.4 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.3 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.2 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.1 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.22.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.21.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.20.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.19.4 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.19.3 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.19.2 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.19.1 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.19.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.18.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb
opentelemetry-instrumentation-restclient-0.17.0 lib/opentelemetry/instrumentation/restclient/instrumentation.rb