Closed prashantidealittechno closed 2 years ago
Hi,
The request ID is stored on a thread local so this is not going to work. A thread pool reuses threads, so copying across the request ID automatically isn't likely to be a good idea either (even if it were possible).
If you need to correlate your background-work threads with the request-handling thread, I'd suggest explicitly passing your request ID along to the functions that run in your threads and then logging the ID manually.
I'm open to suggestions on other ways to solve this but I'll close the issue for now as it's not something that is supported currently.
In the thread pull executor, I am calling multiple 3rd party APIs in parallel but in the log, it set the log request id none.
Link for thread pool executor: https://docs.python.org/3/library/concurrent.futures.html