-
-
Notifications
You must be signed in to change notification settings - Fork 27
Improve async queue tracing #895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add queue name tracking through driver factory aspect interception - Include message ID, queue name, and body size in tracing spans - Track message latency between publish and process - Enhance carrier packing to support extra metadata - Remove unused Throwable import - Set proper start timestamps for queue processing transactions This enhancement provides better observability for async queue operations by capturing comprehensive messaging metrics including latency, message size, and proper queue identification.
|
Caution Review failedThe pull request is closed. Walkthrough扩展异步队列追踪:拦截范围加入 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App as App Code
participant DF as DriverFactory
participant Aspect as AsyncQueueJobMessageAspect
participant Driver as QueueDriver
participant Ctx as Context
participant L as TracingAsyncQueueListener
rect rgb(245,248,255)
App->>DF: get(name?)
activate Aspect
Aspect->>Ctx: set("sentry.async_queue.name", name or "default")
deactivate Aspect
DF-->>App: QueueDriver
end
rect rgb(245,255,245)
App->>Driver: push(job)
activate Aspect
Aspect->>Aspect: create span (name=job::class)
Aspect->>Ctx: get("sentry.async_queue.name")
Aspect->>Aspect: compute messageId, bodySize
Aspect->>Aspect: enrich span data (+Redis when applicable)
Aspect->>Aspect: pack carrier (publish_time, message_id, queue_name, body_size)
Aspect->>Ctx: set("TRACE_CARRIER", carrier)
deactivate Aspect
Driver-->>App: push result
end
rect rgb(255,248,245)
L->>Ctx: get("TRACE_CARRIER")
L->>L: continueTrace(...).setStartTimestamp(now)
L->>L: finishTransaction(data from carrier + latency)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.17)Note: Using configuration file /phpstan.neon.dist. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
* feat: improve async queue tracing with detailed messaging metrics - Add queue name tracking through driver factory aspect interception - Include message ID, queue name, and body size in tracing spans - Track message latency between publish and process - Enhance carrier packing to support extra metadata - Remove unused Throwable import - Set proper start timestamps for queue processing transactions This enhancement provides better observability for async queue operations by capturing comprehensive messaging metrics including latency, message size, and proper queue identification. * feat: add messaging system metadata to async queue tracing --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Summary by CodeRabbit