Skip to content

feat(sidekiq): add opt-in ActiveJob reporting through sentry-rails - #3134

Open
solnic wants to merge 1 commit into
chore/3119-switch-activejob-integration-to-the-backend-extension-registryfrom
chore/2937-migrate-sentry-sidekiq-to-aj-first-integration
Open

solnic wants to merge 1 commit into
chore/3119-switch-activejob-integration-to-the-backend-extension-registryfrom
chore/2937-migrate-sentry-sidekiq-to-aj-first-integration

Conversation

@solnic

@solnic solnic commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

sentry-sidekiq can now leave ActiveJob jobs running on Sidekiq to sentry-rails. By default ActiveJob::QueueAdapters::SidekiqAdapter stays in config.rails.skippable_job_adapters, so sentry-sidekiq keeps reporting them. Rails apps opt in by removing it:

Sentry.init do |config|
  config.rails.skippable_job_adapters.delete("ActiveJob::QueueAdapters::SidekiqAdapter")
end

Once opted in, Sentry::Sidekiq::ActiveJobExtension reports those jobs with a Sidekiq/<JobClass> transaction name, the auto.queue.sidekiq origin and Sentry::Sidekiq as the integration. The client middleware still records the queue.publish span. sentry-sidekiq still reports errors raised before the job starts. report_after_job_retries, report_only_dead_jobs and attempt_threshold only apply to those errors.

Job extensions

A Sidekiq process runs plain Sidekiq workers and ActiveJob jobs wrapped in ActiveJob's JobWrapper. A job is reported either by sentry-sidekiq's middleware, which sees the Sidekiq job hash, or by sentry-rails' ActiveJob hook, which sees the ActiveJob::Base instance. Each extension covers one of those cases:

Extension Reports Called by Receives
Sentry::Sidekiq::JobExtension plain Sidekiq workers sentry-sidekiq's middleware and error handler the Sidekiq job hash
Sentry::Sidekiq::ActiveJobSupport::JobExtension ActiveJob jobs sentry-sidekiq reports itself (the default) the same middleware, for jobs with "wrapped" the Sidekiq job hash
Sentry::Sidekiq::ActiveJobExtension ActiveJob jobs of apps that opted in sentry-rails' ActiveJob hook the ActiveJob::Base instance

ActiveJobSupport::JobExtension subclasses JobExtension and only adds the ActiveJob handling these jobs already get today: naming them after the wrapped class and stripping ActiveJob's _aj_ keys from the error context. ActiveJobExtension subclasses Sentry::Rails::ActiveJobExtension and keeps Sidekiq's identity. The two ActiveJob extensions receive different objects and need different superclasses, so they stay separate.


Closes #3122
Closes #2937

@solnic
solnic added this pull request to stack #3135 October 13, 2026 13:17
cursor[bot]

This comment was marked as resolved.

@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 4586b71 to 412cdfc Compare October 13, 2026 13:23
@solnic
solnic marked this pull request as draft October 13, 2026 13:25
cursor[bot]

This comment was marked as resolved.

@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch 2 times, most recently from 906473e to 4f51c1c Compare October 14, 2026 06:13
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 4f51c1c to 185934b Compare October 14, 2026 06:31
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch 3 times, most recently from 7671f66 to 87c690c Compare October 14, 2026 08:23
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch 2 times, most recently from 91bbe8e to 5520b91 Compare October 14, 2026 10:34
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 5520b91 to e76091f Compare October 14, 2026 10:56
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from e76091f to 6014ce1 Compare October 14, 2026 11:42
@solnic
solnic removed this pull request from stack #3135 October 14, 2026 11:44
@solnic
solnic changed the base branch from chore/3121-queues-module-conformance-improvements to chore/3119-switch-activejob-integration-to-the-backend-extension-registry October 14, 2026 11:44
@solnic
solnic added this pull request to stack #3137 October 14, 2026 11:44
@solnic
solnic marked this pull request as ready for review October 14, 2026 11:49
cursor[bot]

This comment was marked as resolved.

@solnic
solnic marked this pull request as draft October 15, 2026 08:25
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 84ac741 to 97641bf Compare October 15, 2026 12:45
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 97641bf to 9a3e4f4 Compare October 15, 2026 12:51
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 9a3e4f4 to 2768792 Compare October 15, 2026 13:37

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@solnic
solnic marked this pull request as draft October 20, 2026 08:52
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 2d1682c to 29d356b Compare October 20, 2026 12:44
@solnic
solnic marked this pull request as ready for review October 20, 2026 12:48
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 29d356b to f14ea37 Compare October 20, 2026 12:57
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch 3 times, most recently from 2d0869f to bb45494 Compare October 23, 2026 10:52
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from bb45494 to 04e3b14 Compare October 23, 2026 11:49
@solnic solnic changed the title feat(sidekiq): migrate to ActiveJob-first integration feat(sidekiq): add opt-in ActiveJob handoff to sentry-rails Nov 2, 2026
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 04e3b14 to 2f85024 Compare November 2, 2026 15:56
@solnic
solnic marked this pull request as draft November 2, 2026 15:58
@solnic
solnic force-pushed the chore/2937-migrate-sentry-sidekiq-to-aj-first-integration branch from 2f85024 to 64c07a7 Compare November 2, 2026 15:59

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 336b959. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidekiq: extract shared building blocks Migrate sentry-sidekiq to AJ-first integration

1 participant