Sha256: d5d1ca0726ec4a24b3f4c550ef0087ab4fe9cc903f6620e0a69371b05a8860a2

Contents?: true

Size: 753 Bytes

Versions: 20

Compression:

Stored size: 753 Bytes

Contents

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

module Datadog
  module Contrib
    # Datadog Net/HTTP integration.
    module HTTP
      # Patcher enables patching of 'net/http' module.
      module Patcher
        include Contrib::Patcher

        module_function

        def patched?
          done?(:http)
        end

        # patch applies our patch if needed
        def patch
          do_once(:http) do
            begin
              ::Net::HTTP.send(:include, Instrumentation)
            rescue StandardError => e
              Datadog::Tracer.log.error("Unable to apply net/http integration: #{e}")
            end
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.29.1 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.26.1 lib/ddtrace/contrib/http/patcher.rb
ls-trace-0.1.1 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.29.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.28.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.27.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.26.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.25.1 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.25.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.24.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.23.3 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.23.2 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.23.1 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.23.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.22.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.21.2 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.21.1 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.21.0 lib/ddtrace/contrib/http/patcher.rb
ddtrace-0.20.0 lib/ddtrace/contrib/http/patcher.rb