Record the Delayed Job enqueue as a producer span - #1538
Merged
Conversation
|
✔️ All good! |
unflxw
force-pushed
the
delayed-job-collector-mode
branch
2 times, most recently
from
July 9, 2026 17:29
ca5860d to
a91de42
Compare
Enqueuing a Delayed Job now records an `enqueue.delayed_job` event on the active transaction, so enqueues made from a web request or another job show up in the event timeline. Delayed Job was the only background job backend still missing this. Test it against Delayed Job's in-memory test backend under a new `delayed_job` gemfile, driving the real enqueue and perform lifecycle rather than a stubbed one.
unflxw
force-pushed
the
delayed-job-collector-mode
branch
from
July 9, 2026 17:40
a91de42 to
13eba8d
Compare
There was a problem hiding this comment.
Pull request overview
Adds Delayed Job enqueue instrumentation to AppSignal, including collector-mode OpenTelemetry semantics by recording the enqueue as a PRODUCER span (without trace-context propagation, matching OTel’s Delayed Job approach). This closes the gap where Delayed Job previously lacked enqueue timeline visibility compared to other job backends.
Changes:
- Add
around(:enqueue)instrumentation inDelayedJobPluginto recordenqueue.delayed_jobwith:opentelemetry_kind => :producer. - Replace the Delayed Job integration spec with end-to-end coverage using Delayed Job’s in-memory test backend, covering agent + collector modes.
- Add delayed_job gemfiles and CI/build-matrix entries to run the new integration specs.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/support/stubs/delayed_job.rb | (Content not provided in prompt) Delayed Job test stubs/support adjustments. |
| spec/support/helpers/dependency_helper.rb | Add delayed_job_present? to gate specs on bundle contents. |
| spec/lib/appsignal/integrations/delayed_job_plugin_spec.rb | New end-to-end Delayed Job enqueue/perform specs (agent + collector). |
| spec/lib/appsignal/hooks/delayed_job_spec.rb | Make hook installation deterministic by installing directly and hiding constants in the “without” case. |
| lib/appsignal/integrations/delayed_job_plugin.rb | Record enqueue.delayed_job and mark it as a producer span in collector mode. |
| gemfiles/delayed_job.gemfile | New gemfile to run Delayed Job integration tests. |
| gemfiles/delayed_job-collector.gemfile | Generated collector overlay gemfile for Delayed Job. |
| build_matrix.yml | Add delayed_job gemfile variant to the build matrix. |
| .github/workflows/ci.yml | Generated CI workflow updates to include delayed_job jobs. |
| .changesets/add-delayed-job-enqueue-instrumentation.md | Changeset documenting the new enqueue instrumentation (minor bump). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In collector mode the `enqueue.delayed_job` event now opens a producer span, matching the other job backends and OpenTelemetry's own Delayed Job instrumentation. Delayed Job has no envelope to carry trace context across the enqueue/perform boundary, so -- like OpenTelemetry -- nothing is injected and the producer and consumer spans are not linked. Dual-modes the Delayed Job specs so the collector-mode span shapes are covered alongside the agent-mode ones.
unflxw
force-pushed
the
delayed-job-collector-mode
branch
from
July 10, 2026 06:47
13eba8d to
a84a4a2
Compare
This comment has been minimized.
This comment has been minimized.
unflxw
force-pushed
the
wip-otel-rework
branch
2 times, most recently
from
July 13, 2026 12:41
31d2771 to
c220cce
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
tombruijn
approved these changes
Jul 15, 2026
|
This is a message from the daily scheduled checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #1537. This branch is cut from #1535 and cherry-picks that PR's commit, so the collector-mode change can be reviewed against the OpenTelemetry branch here. Once #1537 merges to
mainandwip-otel-reworkis rebased on top of it, the first commit drops out and only the second remains.Delayed Job is the one background-job backend with no metadata envelope to carry trace context: its payload is a YAML dump of the user's own object, so linking the enqueue to the perform would mean mutating that object and re-serialising it. OpenTelemetry's own Delayed Job instrumentation reaches the same conclusion, so we match it — a
PRODUCERspan on enqueue and aCONSUMERspan on perform, no wire propagation, and the two are not linked. Active Job over Delayed Job still links, through the Active Job__otel_headerslayer.Both commits are tested against Delayed Job's own in-memory test backend (under the new
delayed_jobgemfile), driving the real enqueue and perform lifecycle in agent and collector mode.Record the Delayed Job enqueue as a producer span
In collector mode the
enqueue.delayed_jobevent now opens a producerspan, matching the other job backends and OpenTelemetry's own Delayed
Job instrumentation. Delayed Job has no envelope to carry trace context
across the enqueue/perform boundary, so -- like OpenTelemetry -- nothing
is injected and the producer and consumer spans are not linked.
Dual-modes the Delayed Job specs so the collector-mode span shapes are
covered alongside the agent-mode ones.