lib/ddtrace/contrib/http/patcher.rb in ddtrace-0.11.0 vs lib/ddtrace/contrib/http/patcher.rb in ddtrace-0.11.1
- old
+ new
@@ -42,11 +42,10 @@
!Datadog.configuration[:http][:distributed_tracing]
end
# Patcher enables patching of 'net/http' module.
- # This is used in monkey.rb to automatically apply patches
module Patcher
include Base
register_as :http, auto_patch: true
option :distributed_tracing, default: false
@@ -58,11 +57,10 @@
def patch
unless @patched
begin
require 'uri'
require 'ddtrace/pin'
- require 'ddtrace/monkey'
require 'ddtrace/ext/app_types'
require 'ddtrace/ext/http'
require 'ddtrace/ext/net'
require 'ddtrace/ext/distributed'
@@ -85,10 +83,10 @@
# rubocop:disable Metrics/BlockLength
# rubocop:disable Metrics/AbcSize
def patch_http
::Net::HTTP.class_eval do
alias_method :initialize_without_datadog, :initialize
- Datadog::Monkey.without_warnings do
+ Datadog::Patcher.without_warnings do
remove_method :initialize
end
def initialize(*args)
pin = Datadog::Pin.new(SERVICE, app: APP, app_type: Datadog::Ext::AppTypes::WEB)