Module: Datadog::Tracing::Contrib::Presto::Patcher

Includes:
Datadog::Tracing::Contrib::Patcher
Defined in:
lib/datadog/tracing/contrib/presto/patcher.rb

Overview

Patcher enables patching of ‘presto-client’ module.

Constant Summary collapse

PATCH_ONLY_ONCE =
Core::Utils::OnlyOnce.new

Class Method Summary collapse

Methods included from Datadog::Tracing::Contrib::Patcher

included

Class Method Details

.patchObject



22
23
24
25
26
27
28
29
30
# File 'lib/datadog/tracing/contrib/presto/patcher.rb', line 22

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

.patched?Boolean

Returns:

  • (Boolean)


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

def patched?
  PATCH_ONLY_ONCE.ran?
end