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

Defined in:
lib/opentelemetry/instrumentation/faraday/patches/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

#initialize(*args) ⇒ Object



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

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