getsentry / getsentry/sentry-ruby

Migrate `sentry-sidekiq` to AJ-first integration

Abierto
#2,937 1 comentario 0 reacciones 1 asignado Reclamado por @solnic Ver en GitHub
Improvement Ruby Spans
Lenguaje dominante
Ruby
Estrellas
987
Forks
541
Merge medio
17 h 40 min
PR fusionados (30 d)
19

Descripción

Part of getsentry/sentry-ruby#2932.

Most complex existing integration — client + server middleware, error handler, retry semantics, crons, scheduler. AJ-wrapped Sidekiq jobs currently go through both `sentry-sidekiq` and `sentry-rails` (the `skippable_job_adapters` registration suppresses the double-report). This phase makes Sidekiq correctly defer the AJ path to `sentry-rails` while keeping sidekiq-native coverage untouched.

**This phase must land atomically** — the dual-path detection changes and the `skippable_job_adapters` unregistration (4.4) ship together so there is no window where sidekiq+AJ jobs are either double-reported or unreported.

## Tasks

* **4.1** Detect AJ-wrapped jobs in server middleware. In `SentryContextServerMiddleware`, recognize both `ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper` (legacy) and `Sidekiq::ActiveJob::Wrapper` (Sidekiq 7+). When detected, skip the Sidekiq perform transaction in favor of the AJ one (or downgrade to a thin wrapper span — decision in issue). No duplicate transactions.
* **4.2** Detect AJ-wrapped jobs in error handler. Update `ErrorHandler#call` so AJ-wrapped failures are left to the AJ integration. Sidekiq-native error capture unchanged.
* **4.3** Align client middleware `queue.publish` span with AJ's producer span. `SentryContextClientMiddleware` already opens a publish span; when the job is AJ-wrapped, suppress or nest — decide and document.
* **4.4** Unregister from `skippable_job_adapters` (per Phase 1.6 decision). Strip the Railtie block at `sentry-sidekiq.rb#L17-L24`.
* **4.5** Wire Sidekiq into the shared contract. Thin spec in `sentry-sidekiq` that runs the AJ shared suite against the Sidekiq adapter, asserting zero duplicate events / zero duplicate transactions.
* **4.6** Add Sidekiq-native backend-specific spec coverage. Dedicated spec file(s) covering Sidekiq-only surface (retry middleware, dead set, scheduler interactions). Existing Sidekiq specs get ported into this structure.
* **4.7** Retire the legacy `activejob_spec.rb`. By end of this phase it is fully superseded; delete it.

## Depends on

Phase 1 (ActiveJob core integration in `sentry-rails`)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.