Labels / Complexity: observability · Trivial — 2 pts
Summary
The backend has a CorrelationMiddleware (app/middleware/correlation.py) that generates or propagates correlation IDs, but request logging does not include the correlation ID in every log entry. This makes it difficult to trace requests across services when debugging issues.
Proposal
- Update
app/core/logging_config.py to include correlation_id in the log format
- Ensure all loggers use the correlation context from
app/utils/correlation_ctx.py
- Verify that the correlation ID is included in the
X-Correlation-ID response header
Acceptance criteria
Out of scope
Distributed tracing with OpenTelemetry (already implemented via app/core/tracing.py).
Getting started
Files in scope:
app/core/logging_config.py
app/middleware/correlation.py
app/utils/correlation_ctx.py
Build/test commands:
pytest tests/test_correlation_exceptions.py
Good first files to read: app/middleware/correlation.py, app/core/logging_config.py.
Labels / Complexity: observability · Trivial — 2 pts
Summary
The backend has a
CorrelationMiddleware(app/middleware/correlation.py) that generates or propagates correlation IDs, but request logging does not include the correlation ID in every log entry. This makes it difficult to trace requests across services when debugging issues.Proposal
app/core/logging_config.pyto includecorrelation_idin the log formatapp/utils/correlation_ctx.pyX-Correlation-IDresponse headerAcceptance criteria
correlation_idfieldX-Correlation-IDheader is present in all API responsesOut of scope
Distributed tracing with OpenTelemetry (already implemented via
app/core/tracing.py).Getting started
Files in scope:
app/core/logging_config.pyapp/middleware/correlation.pyapp/utils/correlation_ctx.pyBuild/test commands:
Good first files to read:
app/middleware/correlation.py,app/core/logging_config.py.