Skip to content

Commit 1c10d02

Browse files
authored
docs: ✏️ Sidekiq instrumentation options (#824)
1 parent b9b9df3 commit 1c10d02

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

instrumentation/sidekiq/.yardopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--title=OpenTelemetry Sidekiq Instrumentation
33
--markup=markdown
44
--main=README.md
5+
--tag=instrumentation_option_default:"Default"
56
./lib/opentelemetry/instrumentation/**/*.rb
67
./lib/opentelemetry/instrumentation.rb
78
-

instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/instrumentation.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,59 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
2727
gem_version >= MINIMUM_VERSION
2828
end
2929

30+
# @!group Instrumentation Options
31+
# @!macro
32+
# @!method $1
33+
# @instrumentation_option_default `:$2`
34+
# @!scope class
35+
#
36+
# Specify how the span names are set. Can be one of:
37+
#
38+
# - `:queue` - the span names will be set to '<destination / queue name> <operation>'.
39+
# - `:job_class` - the span names will be set to '<job class name> <operation>'.
3040
option :span_naming, default: :queue, validate: %I[job_class queue]
41+
# Controls how the job's execution is traced and related
42+
# to the trace where the job was enqueued. Can be one of:
43+
#
44+
# - `:link` - the job will be executed in a separate trace. The
45+
# initial span of the execution trace will be linked to the span that
46+
# enqueued the job, via a Span Link.
47+
# - `:child` - the job will be executed in the same logical trace, as a direct
48+
# child of the span that enqueued the job.
49+
# - `:none` - the job's execution will not be explicitly linked to the span that
50+
# enqueued the job.
3151
option :propagation_style, default: :link, validate: %i[link child none]
52+
# @!macro
53+
# @!method $1
54+
# @instrumentation_option_default `:$2`
55+
# @!scope class
56+
# Allows tracing Sidekiq::Launcher#heartbeat.
3257
option :trace_launcher_heartbeat, default: false, validate: :boolean
58+
# @!macro
59+
# @!method $1
60+
# @instrumentation_option_default $2
61+
# @!scope class
62+
# Allows tracing Sidekiq::Scheduled#enqueue.
3363
option :trace_poller_enqueue, default: false, validate: :boolean
64+
# @!macro
65+
# @!method $1
66+
# @instrumentation_option_default $2
67+
# @!scope class
68+
# Allows trasing Sidekiq::Scheduled#wait
3469
option :trace_poller_wait, default: false, validate: :boolean
70+
# @!macro
71+
# @!method $1
72+
# @instrumentation_option_default $2
73+
# @!scope class
74+
# Allows tracing Sidekiq::Processor#process_one.
3575
option :trace_processor_process_one, default: false, validate: :boolean
76+
# @!macro
77+
# @!method $1
78+
# @instrumentation_option_default $2
79+
# @!scope class
80+
# Sets service name of the remote service.
3681
option :peer_service, default: nil, validate: :string
82+
# @!endgroup
3783

3884
private
3985

0 commit comments

Comments
 (0)