Open
Description
Is your feature request related to a problem? Please describe.
In cloud services, it's common practice to attach a trace ID to each request that is processed. When logging with alog
, this id should be included as a field in the metadata of every log line during the request's scope.
Describe the solution you'd like
The metadata be attached to the call stack (and not a local thread ID) so that all log lines made within a call stack will have the ID included as a field.
Describe alternatives you've considered
Attaching a trace ID to a thread using threading.local
is a simple solution, but insufficient to properly handle several cases:
- Threads that spawn other threads
- Requests handled with long-lived threads from a pool
Metadata
Metadata
Assignees
Labels
No labels