Sha256: 4116eee48bd52a4e662173af3b4cfea51db30aa2f56f980d03cc732ca31305b2

Contents?: true

Size: 707 Bytes

Versions: 5

Compression:

Stored size: 707 Bytes

Contents

require 'ddtrace/contrib/patcher'
require 'ddtrace/contrib/presto/ext'
require 'ddtrace/contrib/presto/instrumentation'

module Datadog
  module Contrib
    module Presto
      # Patcher enables patching of 'presto-client' module.
      module Patcher
        include Contrib::Patcher

        module_function

        def patched?
          done?(:presto)
        end

        def patch
          do_once(:presto) do
            begin
              ::Presto::Client::Client.send(:include, Instrumentation::Client)
            rescue StandardError => e
              Datadog::Logger.log.error("Unable to apply Presto integration: #{e}")
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.34.2 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.34.1 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.34.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.33.1 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.33.0 lib/ddtrace/contrib/presto/patcher.rb