Module: Datadog::Tracing::Contrib::HTTPX::Patcher

Includes:
Patcher
Defined in:
lib/httpx/adapters/datadog.rb

Overview

Patcher enables patching of 'httpx' with datadog components.

Class Method Summary collapse

Class Method Details

.patchObject

loads a session instannce with the datadog plugin, and replaces the base HTTPX::Session with the patched session class.



302
303
304
305
306
307
308
309
# File 'lib/httpx/adapters/datadog.rb', line 302

def patch
  datadog_session = ::HTTPX.plugin(Plugin)

  ::HTTPX.send(:remove_const, :Session)
  ::HTTPX.send(:const_set, :Session, datadog_session.class)

  ::HTTPX::Loggable.singleton_class.prepend(LoggablePatch)
end

.target_versionObject



296
297
298
# File 'lib/httpx/adapters/datadog.rb', line 296

def target_version
  Integration.version
end