Skip to content

BE07 – Request Tracing Middleware#237

Open
nethmiWee wants to merge 2 commits intomasterfrom
backendMetrics
Open

BE07 – Request Tracing Middleware#237
nethmiWee wants to merge 2 commits intomasterfrom
backendMetrics

Conversation

@nethmiWee
Copy link
Copy Markdown
Collaborator

@nethmiWee nethmiWee commented Apr 26, 2026

Created requestID to add on to for better logging and tracing

image

@nethmiWee nethmiWee self-assigned this Apr 26, 2026
@TienNguyen3711
Copy link
Copy Markdown
Collaborator

This PR is moving in the right direction for request tracing, but I do not think it is ready to merge yet because there are still a few issues that need to be fixed for tracing to work consistently.

Items to address:

  • requestId is currently being created/assigned more than once, so there should be a single source of truth for the entire request flow. Right now there is a risk that the X-Request-Id response header does not match the requestId shown in logs or error responses.
  • The request property should be standardized, for example by using only req.requestId, instead of mixing req.id and req.requestId.
  • uncaughtExceptionHandler is referencing req out of scope and should be fixed so it does not introduce a new failure in the error path.
  • The main logging paths should consistently include the same requestId, especially in request logging, auth/session flows, the structured error handler, and warning/error logs in middleware.
  • After these fixes, it would be good to re-verify that:
    • each request gets exactly one unique requestId
    • the response header and/or error response returns that same requestId
    • the same requestId appears in both request logs and error logs

The broader automation/shared-flow validation and tracing support for web/mobile debugging can continue under Task BE35, but the core request tracing behaviour should be completed before this PR is merged.

@Vedant1515
Copy link
Copy Markdown
Collaborator

Yes, do what Tien Guided and , resolve merge conflicts as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants