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
-
#initialize(*args) ⇒ Object
Wraps Faraday::Connection#initialize: https://github.com/lostisland/faraday/blob/ff9dc1d1219a1bbdba95a9a4cf5d135b97247ee2/lib/faraday/connection.rb#L62-L92.
Instance Method Details
#initialize(*args) ⇒ Object
Wraps Faraday::Connection#initialize: https://github.com/lostisland/faraday/blob/ff9dc1d1219a1bbdba95a9a4cf5d135b97247ee2/lib/faraday/connection.rb#L62-L92
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 |