Sha256: e70b7e93bf3992598b9f982f8ba479d16f69ca10f1f8acd3afd48b062f7ee9c6

Contents?: true

Size: 702 Bytes

Versions: 15

Compression:

Stored size: 702 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.error("Unable to apply Presto integration: #{e}")
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
ddtrace-0.46.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.45.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.44.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.43.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.42.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.41.0 lib/ddtrace/contrib/presto/patcher.rb
ls-trace-0.2.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.40.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.39.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.38.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.37.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.36.0 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.35.2 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.35.1 lib/ddtrace/contrib/presto/patcher.rb
ddtrace-0.35.0 lib/ddtrace/contrib/presto/patcher.rb