Skip to content

Add distributed tracing and dynamic sampling support for all background queues #1904

Closed

Description

@sl0thentr0py

use continue_trace before start_transaction in

  • resque (native, non-ActiveJob jobs only)
  • delayed_job
  • active_job
  • sidekiq (native, non-ActiveJob jobs)

Status (checked against sentry-ruby source, 2026-09-08)

  • active_job — done. Sentry::Rails::ActiveJobExtensions::SentryReporter.record (sentry-rails/lib/sentry/rails/active_job.rb) calls Sentry.continue_trace(trace_headers, **transaction_options) before Sentry.start_transaction, shipped in 6.7.0 via #2947. This covers Sidekiq+AJ, Resque+AJ, DelayedJob+AJ, and SolidQueue, since all AJ-backed adapters route perform through this shared reporter.

  • delayed_job — done. Sentry::DelayedJob::Plugin.start_transaction (sentry-delayed_job/lib/sentry/delayed_job/plugin.rb) calls Sentry.continue_trace(env, **options) before Sentry.start_transaction.

  • resque — still open, but only for native (non-ActiveJob) Resque workers. Sentry::Resque::SentryReporter.record (sentry-resque/lib/sentry/resque.rb) calls Sentry.start_transaction directly with no continue_trace step, so trace propagation is missing for jobs that don't go through the ResqueAdapter/ActiveJob wrapper. Jobs enqueued via ActiveJob on the Resque adapter already get continuation through the active_job path above.

  • sidekiq — done, and predates 6.7.0. Sentry::Sidekiq::SentryContextServerMiddleware#start_transaction (sentry-sidekiq/lib/sentry/sidekiq/sentry_context_middleware.rb) already calls Sentry.continue_trace(env, **options) before Sentry.start_transaction. Not in the original checklist but confirmed complete for native Sidekiq jobs; AJ-wrapped Sidekiq jobs also get continuation via the active_job path.

Remaining work: add continue_trace support to the native sentry-resque reporter (or confirm out of scope now that sentry-resque is maintenance-only per the Queue Integrations Overhaul project).

Activity

  1. added this to the Dynamic Sampling milestone on Sep 28, 2022
  2. self-assigned this
    on Sep 28, 2022
  3. changed the title [-]Add dynamic sampling support for all background queues[/-] [+]Add distriburted tracing and dynamic sampling support for all background queues[/+] on Oct 22, 2024
  4. changed the title [-]Add distriburted tracing and dynamic sampling support for all background queues[/-] [+]Add distributed tracing and dynamic sampling support for all background queues[/+] on Oct 22, 2024
  5. removed this from the Dynamic Sampling milestone on Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions