Module: OpenTelemetry::Instrumentation::Faraday::Patches::Stable::Connection

Defined in:
lib/opentelemetry/instrumentation/faraday/patches/stable/connection.rb

Overview

Module to be prepended to force Faraday to use the middleware by default so the user doesn't have to call use for every connection.

Instance Method Summary collapse

Instance Method Details

#initializeObject



17
18
19
20
21
22
23
# File 'lib/opentelemetry/instrumentation/faraday/patches/stable/connection.rb', line 17

def initialize(...)
  super.tap do
    use(:open_telemetry) unless builder.handlers.any? do |handler|
      handler.klass == Middlewares::Stable::TracerMiddleware
    end
  end
end