Module: Datadog::Tracing::Contrib::Httprb::Patcher

Includes:
Patcher
Defined in:
lib/datadog/tracing/contrib/httprb/patcher.rb

Overview

Patcher enables patching of ‘httprb’ module.

Constant Summary collapse

PATCH_ONLY_ONCE =
Core::Utils::OnlyOnce.new

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.patchObject

patch applies our patch



27
28
29
30
31
32
33
34
35
# File 'lib/datadog/tracing/contrib/httprb/patcher.rb', line 27

def patch
  PATCH_ONLY_ONCE.run do
    begin
      ::HTTP::Client.include(Instrumentation)
    rescue StandardError => e
      Datadog.logger.error("Unable to apply httprb integration: #{e}")
    end
  end
end

.patched?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/datadog/tracing/contrib/httprb/patcher.rb', line 18

def patched?
  PATCH_ONLY_ONCE.ran?
end

.target_versionObject



22
23
24
# File 'lib/datadog/tracing/contrib/httprb/patcher.rb', line 22

def target_version
  Integration.version
end