module Datadog::Contrib::Presto::Patcher

Patcher enables patching of 'presto-client' module.

Constants

PATCH_ONLY_ONCE

Public Instance Methods

patch() click to toggle source
# File lib/ddtrace/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?() click to toggle source
# File lib/ddtrace/contrib/presto/patcher.rb, line 18
def patched?
  PATCH_ONLY_ONCE.ran?
end