Description
Log entries currently lack a correlation ID, making tracing across services difficult.
Goal
Generate a X-Request-Id header for each incoming request (or use the inbound header if present) and include it in all tracing logs.
Tasks
- Create a middleware that checks for
X-Request-Id; if missing, generate a UUID and add it to the request extensions and response headers.
- Configure
tracing to include the request ID in each span (%{request_id} field).
- Ensure errors and panics log the request ID.
- Add a unit test confirming the header propagation.
Acceptance Criteria
- Every request receives a unique ID visible in logs and response headers.
- Correlated log entries can be filtered by request ID.
Dependencies
Depends on: None
Blocks: None
Description
Log entries currently lack a correlation ID, making tracing across services difficult.
Goal
Generate a
X-Request-Idheader for each incoming request (or use the inbound header if present) and include it in alltracinglogs.Tasks
X-Request-Id; if missing, generate a UUID and add it to the request extensions and response headers.tracingto include the request ID in each span (%{request_id}field).Acceptance Criteria
Dependencies
Depends on: None
Blocks: None