Skip to content

ActiveJob core integration in sentry-rails #2934

@solnic

Description

@solnic

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.publish span on enqueue. Hook enqueue.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 + baggage live 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 in SentryReporter.record and continue the producer trace; mirror the sidekiq server-middleware pattern at sentry_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's Span::DataConventions naming.

  • 1.5 Expand shared examples to full AJ feature surface: full lifecycle (scheduled jobs, retry_on / discard_on, rescue_from suppressing + re-raising, ActiveJob::DeserializationError root-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 in sentry-sidekiq, sentry-resque, and sentry-delayed_job.

Depends on

#2932 Phase 0 (shared spec foundation)

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions