Sha256: fa23a2675ac1064ac25c0ff67eb50a94f649512fcb710ec1732b78617ac24bd2

Contents?: true

Size: 790 Bytes

Versions: 27

Compression:

Stored size: 790 Bytes

Contents

module Datadog
  module Contrib
    module Sidekiq
      # Provides instrumentation support for Sidekiq
      module Patcher
        include Base
        VERSION_REQUIRED = Gem::Version.new('4.0.0')
        register_as :sidekiq
        option :service_name, default: 'sidekiq'
        option :tracer, default: Datadog.tracer

        module_function

        def patch
          return unless compatible?

          require_relative 'tracer'

          ::Sidekiq.configure_server do |config|
            config.server_middleware do |chain|
              chain.add(Sidekiq::Tracer)
            end
          end
        end

        def compatible?
          defined?(::Sidekiq) &&
            Gem::Version.new(::Sidekiq::VERSION) >= VERSION_REQUIRED
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ddtrace-0.16.1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.15.0.internaltracinfeature1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.16.0 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.2.disableprotocolversion4 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.15.0 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.2.withoutpriorityparsing1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.2 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.15.0.beta1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.0 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.0.rc1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.13.2 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.0.beta2 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.14.0.beta1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.13.1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.13.0 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.12.1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.13.0.beta1 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.12.0 lib/ddtrace/contrib/sidekiq/patcher.rb
ddtrace-0.12.0.rc1 lib/ddtrace/contrib/sidekiq/patcher.rb