From 9658d3e5804ab1e2180a70b6b19386592731fd78 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Mon, 20 May 2024 10:01:04 +0200 Subject: [PATCH] Use the job class as span name for Sidekiq root spans (#30353) --- config/initializers/opentelemetry.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/initializers/opentelemetry.rb b/config/initializers/opentelemetry.rb index 9af0ab89c86..cf9f0b96f3b 100644 --- a/config/initializers/opentelemetry.rb +++ b/config/initializers/opentelemetry.rb @@ -51,6 +51,9 @@ if ENV.keys.any? { |name| name.match?(/OTEL_.*_ENDPOINT/) } use_rack_events: false, # instead of events, use middleware; allows for untraced_endpoints to ignore child spans untraced_endpoints: ['/health'], }, + 'OpenTelemetry::Instrumentation::Sidekiq' => { + span_naming: :job_class, # Use the job class as the span name, otherwise this is the queue name and not very helpful + }, }) prefix = ENV.fetch('OTEL_SERVICE_NAME_PREFIX', 'mastodon')