-
Notifications
You must be signed in to change notification settings - Fork 3
Improve logging on backend #1015
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
base: staging
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces an AsyncLocalStorage-based ramp processing context system to automatically propagate rampId throughout asynchronous operations, improving logging and error tracking capabilities. The system eliminates the need to explicitly pass rampId through function parameters by making it available via context in all nested async operations.
Changes:
- Added a new
ramp-context.tsmodule implementing AsyncLocalStorage for ramp context management - Modified logger format to automatically include
rampIdfrom context when available - Wrapped ramp processing entry points with
runWithRampContextin phase processor, recovery worker, and cleanup worker
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/api/src/config/ramp-context.ts | New module implementing AsyncLocalStorage for automatic rampId propagation through async call chains |
| apps/api/src/config/logger.ts | Updated logger format to retrieve and display rampId from context, and applied custom format to console transport |
| apps/api/src/api/workers/ramp-recovery.worker.ts | Wrapped recovery operations with runWithRampContext and removed explicit rampId from log messages |
| apps/api/src/api/workers/cleanup.worker.ts | Wrapped cleanup operations with runWithRampContext to provide context for post-processing handlers |
| apps/api/src/api/services/phases/phase-processor.ts | Wrapped main processRamp method with runWithRampContext to establish context for entire phase processing flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Remove nested context wrapper and fix logger spacing
This pull request introduces a new ramp processing context system using
AsyncLocalStorageto automatically propagaterampIdthroughout asynchronous call chains. The main goal is to improve logging and error tracking by ensuring every log message and error handler can access the relevantrampIdwithout explicitly passing it around. This change affects ramp processing, cleanup, and recovery workflows, as well as the logger output format.The logs now include the rampId when available/applicable, see for example: