Context propagation across threads #2884
-
I am trying to trace request that is processed asynchronously. As request is received on a thread, some processing is done and the request is put on a queue. The queue is serviced by a executor service thread pool. To trace this request, I am trying to use Context propagation. As the request is received, the context is
Then on the executor service thread, context is
Is my understanding correct? This is not working for me. The spans don't share the same traceId hence not traceable as one request on Jaeger. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
This does look roughly correct. Without doing some detailed debugging, though, it's a little hard to see where things could be going wrong. Do you have a full example somewhere that we could take a look at? |
Beta Was this translation helpful? Give feedback.
-
If you just want to propagate across threads within the same process, you don't need context propagators (extract/inject). You can just pass the |
Beta Was this translation helpful? Give feedback.
This does look roughly correct. Without doing some detailed debugging, though, it's a little hard to see where things could be going wrong. Do you have a full example somewhere that we could take a look at?