Sha256: 8b21602ae702ff973ff9aed92044e367d776c7a04f6c3587d3c21be1f20021b7

Contents?: true

Size: 815 Bytes

Versions: 12

Compression:

Stored size: 815 Bytes

Contents

# typed: false

require_relative '../patcher'

module Datadog
  module Tracing
    module Contrib
      module DelayedJob
        # Patcher enables patching of 'delayed_job' module.
        module Patcher
          include Contrib::Patcher

          module_function

          def target_version
            Integration.version
          end

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

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.8.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.7.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.6.1 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb