Sha256: b3cb6902c212d597aa687e2aa08a7735f693a38361110a274163a9d09f0840af
Contents?: true
Size: 1.08 KB
Versions: 16
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module Instrumentation module Faraday # The Instrumentation class contains logic to detect and install the Faraday # instrumentation class Instrumentation < OpenTelemetry::Instrumentation::Base install do |_config| require_dependencies register_tracer_middleware use_middleware_by_default end present do defined?(::Faraday) end option :peer_service, default: nil, validate: :string private def require_dependencies require_relative 'middlewares/tracer_middleware' require_relative 'patches/rack_builder' end def register_tracer_middleware ::Faraday::Middleware.register_middleware( open_telemetry: Middlewares::TracerMiddleware ) end def use_middleware_by_default ::Faraday::RackBuilder.prepend(Patches::RackBuilder) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems