Sha256: 3ef7f3834e99721fb65d19d944038fa19fa59aeae9f794b7a5c14c6db6bf7852

Contents?: true

Size: 634 Bytes

Versions: 6

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

# Copyright 2019 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module Faraday
      module Patches
        # 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.
        module RackBuilder
          def adapter(*args)
            use(:open_telemetry) unless @handlers.any? do |handler|
              handler.klass == Faraday::Middlewares::TracerMiddleware
            end

            super
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-faraday-0.10.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
opentelemetry-instrumentation-faraday-0.9.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
opentelemetry-instrumentation-faraday-0.8.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
opentelemetry-instrumentation-faraday-0.7.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
opentelemetry-instrumentation-faraday-0.6.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb
opentelemetry-instrumentation-faraday-0.5.0 lib/opentelemetry/instrumentation/faraday/patches/rack_builder.rb