Class: OpenTelemetry::Instrumentation::Sidekiq::Instrumentation

Inherits:
Base
  • Object
show all
Defined in:
lib/opentelemetry/instrumentation/sidekiq/instrumentation.rb

Overview

The OpenTelemetry::Instrumentation::Sidekiq::Instrumentation class contains logic to detect and install the Sidekiq instrumentation

Installation and configuration of this instrumentation is done within the OpenTelemetry::SDK#configure block, calling use() or use_all().

Configuration keys and options

:span_naming

Specifies how the span names are set. Can be one of:

  • :queue (default) - The job span name will appear as ' ', for example default process.
  • :job_class - The job span name will appear as ' ', for example SimpleJob process.

:propagation_style

Specifies how the job's execution is traced and related to the trace where the job was enqueued.

  • :link (default) - The job will be represented by a separate trace from the span that enqueued the job.
    • The initial span of the job trace will be associated with the span that enqueued the job, via a Span Link.
  • :child - The job will be represented within the same logical trace, as a direct child of the span that enqueued the job.
  • :none - The job will be represented by a separate trace from the span that enqueued the job. There will be no explicit relationship between the job trace and the trace containing the span that enqueued the job.

:trace_launcher_heartbeat

Allows tracing Sidekiq::Launcher#heartbeat.

  • false (default) - Sidekiq::Launcher#heartbeat will not be traced.
  • true - Sidekiq::Launcher#heartbeat will be traced.

:trace_poller_enqueue

Allows tracing Sidekiq::Scheduled#enqueue.

  • false (default) - Sidekiq::Scheduled#enqueue will not be traced.
  • true - Sidekiq::Scheduled#enqueue will be traced.

:trace_poller_wait

Allows tracing Sidekiq::Scheduled#wait.

  • false (default) - Sidekiq::Scheduled#wait will not be traced.
  • true - Sidekiq::Scheduled#wait will be traced.

:trace_processor_process_one

Allows tracing Sidekiq::Processor#process_one.

  • false (default) - Sidekiq::Processor#process_one will not be traced.
  • true - Sidekiq::Processor#process_one will be traced.

:peer_service

Sets service name of the remote service.

  • nil (default)

Examples:

An explicit default configuration

OpenTelemetry::SDK.configure do |c|
  c.use_all({
    'OpenTelemetry::Instrumentation::Sidekiq' => {
      span_naming: :queue,
      propagation_style: :link,
      trace_launcher_heartbeat: true,
    },
  })
end

Constant Summary collapse

MINIMUM_VERSION =
Gem::Version.new('4.2.10')