Module: OpenTelemetry::Instrumentation::Faraday::Patches::RackBuilder

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

#adapter(*args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb', line 14

def adapter(*args)
  use(:open_telemetry) unless @handlers.any? do |handler|
    handler.klass == Faraday::Middlewares::TracerMiddleware
  end

  super
end