You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rails: add optional Good Job labels and concurrency key to ActiveJob error context #3217
When an ActiveJob instance exposes Good Job identity APIs, attach labels and legacy concurrency_key under a good_job context on error (and optionally on the job scope).
Motivation
Official ActiveJob / job-extension reporting already records queue, executions, latency, and messaging fields. It does not record Good Job's concurrency identity (good_job_labels, and on older 4.x good_job_concurrency_key). Those fields help explain why a job was limited or which concurrency cohort it belonged to.
Specification
Duck-type only:
if job.respond_to?(:good_job_labels) -> contexts.good_job.labels = Array(job.good_job_labels)
if job.respond_to?(:good_job_concurrency_key) and value present -> contexts.good_job.concurrency_key
Do not set these as tags (label cardinality).
Hook current ActiveJobExtension context / error-data path (not removed SentryReporter.sentry_context).
No-op when methods are absent.
Guide-level
A failing job that uses Good Job concurrency labels shows contexts.good_job.labels on the event. Hosts on Good Job 5+ without concurrency_key simply omit that field.
Drawbacks / alternatives
Adopt: small adapter-specific branch in a shared ActiveJob path.
Do nothing: lose concurrency cohort signal on errors.
Rejected: tags for labels.
Rejected: nest only under extra if contexts.good_job is unacceptable; prefer contexts for structured identity.
Activity
linear-code commentedon Nov 18, 2026
RUBY-249