module Datadog::Contrib::Httpclient::Patcher

Patcher enables patching of 'httpclient' module.

Constants

PATCH_ONLY_ONCE

Public Instance Methods

patch() click to toggle source

patch applies our patch

# File lib/ddtrace/contrib/httpclient/patcher.rb, line 27
def patch
  PATCH_ONLY_ONCE.run do
    begin
      ::HTTPClient.include(Instrumentation)
    rescue StandardError => e
      Datadog.logger.error("Unable to apply httpclient integration: #{e}")
    end
  end
end
patched?() click to toggle source
# File lib/ddtrace/contrib/httpclient/patcher.rb, line 18
def patched?
  PATCH_ONLY_ONCE.ran?
end
target_version() click to toggle source
# File lib/ddtrace/contrib/httpclient/patcher.rb, line 22
def target_version
  Integration.version
end