Add queue job lifecycle events for monitoring integration#449
Closed
dereuromark wants to merge 1 commit intomasterfrom
Closed
Add queue job lifecycle events for monitoring integration#449dereuromark wants to merge 1 commit intomasterfrom
dereuromark wants to merge 1 commit intomasterfrom
Conversation
LordSimal
reviewed
Nov 23, 2025
d28ff48 to
41c2d1f
Compare
Add events at key lifecycle points to enable integration with monitoring tools like Sentry: - Queue.Job.created: Fired when a job is added to the queue (producer) - Queue.Job.started: Fired when a worker begins processing a job (consumer) - Queue.Job.completed: Fired when a job finishes successfully - Queue.Job.failed: Fired on every job failure (not just when exhausted) Additionally, provide built-in Sentry integration that can be enabled via `Queue.sentry` configuration. When enabled: - Creates queue.publish spans for producer side - Creates queue.process transactions for consumer side - Propagates trace context via job data - Includes all standard messaging attributes Refs: LordSimal/cakephp-sentry#17 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
41c2d1f to
7927e42
Compare
Owner
Author
|
Thats quite a bit of code to support sentry here, but I guess worth it. |
Contributor
|
Thinking about this again I'd say lets just stay with the pure event based system. |
This was referenced Dec 28, 2025
Owner
Author
|
Closing in favor of #453 |
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.
Summary
This PR adds events at key lifecycle points in queue job processing to enable integration with monitoring tools like Sentry:
Queue.Job.created: Fired when a job is added to the queue (producer side)Queue.Job.started: Fired when a worker begins processing a job (consumer side)Queue.Job.completed: Fired when a job finishes successfullyQueue.Job.failed: Fired on every job failure (not just when retries exhausted)These events enable integration with Sentry's Insights - Queues feature and similar monitoring tools. The job entity included in each event provides all necessary data for tracing:
$job->id- Message identifier$job->job_task- Queue/topic name$job->data- Payload for calculating message size$job->attempts- Retry count$job->created,$job->notbefore,$job->fetched- For calculating receive latencyRelated Issues
Test plan
Queue.Job.createdevent in QueuedJobsTableTestQueue.Job.startedevent in ProcessorTestQueue.Job.completedevent in ProcessorTestQueue.Job.failedevent in ProcessorTest🤖 Generated with Claude Code