Sha256: ef4c5796b034bbc125316bd900b14c8144e368bb8c339448260a235fec9c7613

Contents?: true

Size: 799 Bytes

Versions: 2

Compression:

Stored size: 799 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
ddtrace-1.10.1 lib/datadog/tracing/contrib/delayed_job/patcher.rb
ddtrace-1.10.0 lib/datadog/tracing/contrib/delayed_job/patcher.rb