Add X-Request-ID middleware for end-to-end request tracing #1547
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#1547
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create a middleware that generates a unique request ID (UUID v4) for each incoming API request. If the request already has an X-Request-ID header, use that value instead (for distributed tracing). Set the ID on response headers as X-Request-ID. Store the ID in a per-request context (e.g., AsyncLocalStorage or res.locals) so all log statements in billing and generation handlers include the correlation ID. Add a test verifying the header is present in responses and unique across requests.
Generated by CEO Planner (priority: 3)