Module: Datadog::Tracing::Contrib::DelayedJob::Patcher

Includes:
Patcher
Defined in:
lib/datadog/tracing/contrib/delayed_job/patcher.rb

Overview

Patcher enables patching of ‘delayed_job’ module.

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.add_instrumentation(klass) ⇒ Object



25
26
27
# File 'lib/datadog/tracing/contrib/delayed_job/patcher.rb', line 25

def add_instrumentation(klass)
  klass.plugins << Plugin
end

.patchObject



19
20
21
22
23
# File 'lib/datadog/tracing/contrib/delayed_job/patcher.rb', line 19

def patch
  require_relative 'plugin'
  add_instrumentation(::Delayed::Worker)
  patch_server_internals
end

.patch_server_internalsObject



29
30
31
32
# File 'lib/datadog/tracing/contrib/delayed_job/patcher.rb', line 29

def patch_server_internals
  require_relative 'server_internal_tracer/worker'
  ::Delayed::Worker.prepend(ServerInternalTracer::Worker)
end

.target_versionObject



15
16
17
# File 'lib/datadog/tracing/contrib/delayed_job/patcher.rb', line 15

def target_version
  Integration.version
end