Class: Datadog::Contrib::Sidekiq::Integration

Inherits:
Object
  • Object
show all
Includes:
Integration
Defined in:
lib/ddtrace/contrib/sidekiq/integration.rb

Overview

Description of Sidekiq integration

Constant Summary collapse

MINIMUM_VERSION =
Gem::Version.new('3.5.4')
MINIMUM_SERVER_INTERNAL_TRACING_VERSION =
Gem::Version.new('5.2.4')

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Integration

included

Class Method Details

.compatible?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 26

def self.compatible?
  super && version >= MINIMUM_VERSION
end

.compatible_with_server_internal_tracing?Boolean

Only patch server internals on v5.2.4+ because that's when loading of Sidekiq::Launcher stabilized. Sidekiq 4+ technically can support our patches (with minor adjustments), but in order to avoid explicitly requiring sidekiq/launcher ourselves (which could affect gem initialization order), we are limiting this tracing to v5.2.4+.

Returns:

  • (Boolean)


35
36
37
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 35

def self.compatible_with_server_internal_tracing?
  version >= MINIMUM_SERVER_INTERNAL_TRACING_VERSION
end

.loaded?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 22

def self.loaded?
  !defined?(::Sidekiq).nil?
end

.versionObject



18
19
20
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 18

def self.version
  Gem.loaded_specs['sidekiq'] && Gem.loaded_specs['sidekiq'].version
end

Instance Method Details

#default_configurationObject



39
40
41
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 39

def default_configuration
  Configuration::Settings.new
end

#patcherObject



43
44
45
# File 'lib/ddtrace/contrib/sidekiq/integration.rb', line 43

def patcher
  Patcher
end