Creating spans in current context #1651
-
My setupI have setup a small sample project to learn about the implementation of OTEL in Rust. Passing the Context between applications work. When I receive a request I can use the However, my setup is: cli-client --[fetches with http client]--> axum-api --[fetches with http client]--> axum-downstream-api ProblemMy problem is that I lose the context when using the http client in the axum-api to fetch another api. To solve this I currently pass the extracted context from the endpoint handler manually to the fetch method of the http client (see handler, http_client]). Tried solutionFirst I was trying to use Expected vs unexpected resultsThis is the result when trying to use And this is the desired output that I get using the current code (see this): Thanks in advance, I hope I described everything well enough. If not, feel free to ask for more information. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone who might stumble upon the same problem: Here I managed to pass the context from my middleware to the handler, so that |
Beta Was this translation helpful? Give feedback.
For anyone who might stumble upon the same problem:
Here I managed to pass the context from my middleware to the handler, so that
Context::current()
will actually result in the correct context