ActiveJob core integration in sentry-rails #2934
Copy link
Copy link
Closed
Labels
Description
Part of #2932.
This phase ships the "AJ becomes primary" plumbing in sentry-rails, proved against the built-in adapters (:test, :inline, :async) with no external gem involvement.
Tasks
- 1.1 Add a producer-side
queue.publishspan on enqueue. Hookenqueue.active_job/enqueue_at.active_job(or override the AJ methods directly) so enqueuing inside an active transaction opens a child span with messaging data. Add a producer-tracing shared-examples file under the Phase 0 tree and compose it into the top-level shared example. - 1.2 Inject Sentry trace headers into the job payload. Decide where
sentry-trace+baggagelive on the AJ job so every adapter round-trips them (serialized arg vs. adapter-specific metadata). - 1.3 Implement perform-side
continue_trace. Read propagated headers inSentryReporter.recordand continue the producer trace; mirror the sidekiq server-middleware pattern atsentry_context_middleware.rb#L85. Add a distributed-tracing shared-examples file (trace_id continuity, parent_span_id, baggage survival) and compose it in. - 1.4 Populate messaging span data + tags on the perform transaction:
messaging.message.id,messaging.destination.name, retry count, latency, provider job id. Reuse sidekiq'sSpan::DataConventionsnaming. - 1.5 Expand shared examples to full AJ feature surface: full lifecycle (scheduled jobs,
retry_on/discard_on,rescue_fromsuppressing + re-raising,ActiveJob::DeserializationErrorroot-cause,ActionMailer::MailDeliveryJob), full error-capture + context assertions, scope/user/tags propagation, retry + discard semantics (active_job_report_on_retry_error), argument serialization (GlobalID / Range / TimeWithZone), concurrency/scope-isolation. - 1.6 Decide fate of
skippable_job_adapters: (a) remove entirely — AJ is unconditional; or (b) keep as a permanent empty-by-default escape hatch. Decision drives what Phases 2–4 do with their self-registrations insentry-sidekiq,sentry-resque, andsentry-delayed_job.
Depends on
#2932 Phase 0 (shared spec foundation)
Reactions are currently unavailable
Activity
linear-code commentedon Apr 23, 2026
RUBY-172