Concurrent requests interleaved in the log with no way to separate them.
Conversation
Turn 1 — User
I cannot follow a single request through the logs when there is any traffic.
Turn 2 — Assistant
Added a request id generated at the edge, stored in a context variable, and included by the log formatter on every line. Nothing has to pass it explicitly.
It is also returned as a response header, so a report about a specific failed request can be traced directly.
Turn 3 — User
Does it survive a background task?
Turn 4 — Assistant
Only if the task is spawned from the request context. Anything scheduled outside it gets a fresh id, which is correct — it is a different unit of work.
Subjects
- [[REST API]]
- [[Observability]]
- [[Python]]