Module: Datadog::Contrib::Excon::Patcher

Includes:
Patcher
Defined in:
lib/ddtrace/contrib/excon/patcher.rb

Overview

Patcher enables patching of ‘excon’ module.

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.add_middlewareObject



28
29
30
# File 'lib/ddtrace/contrib/excon/patcher.rb', line 28

def add_middleware
  ::Excon.defaults[:middlewares] = Middleware.around_default_stack
end

.patchObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ddtrace/contrib/excon/patcher.rb', line 16

def patch
  do_once(:excon) do
    begin
      require 'ddtrace/contrib/excon/middleware'

      add_middleware
    rescue StandardError => e
      Datadog::Tracer.log.error("Unable to apply Excon integration: #{e}")
    end
  end
end

.patched?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ddtrace/contrib/excon/patcher.rb', line 12

def patched?
  done?(:excon)
end