You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have write a basic fastapi proxy service which use httpx as client. We observe many duplicate trace_ids across total different requests in our product environment, but after review the code and try local, we are unable to reproduce this situation.
Currently, The bug is the second request while walk into the asgi middleware. As it call the method _start_internal_or_server_span it will get the last request's <operation_name> http send span as its parent span, so the duplicatiion happen.
We mock the middleware code to log some log like below.
Describe your environment
OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.8.10)
Package version: (e.g., 0.46.0)
What happened?
We have write a basic fastapi proxy service which use httpx as client. We observe many duplicate trace_ids across total different requests in our product environment, but after review the code and try local, we are unable to reproduce this situation.
Currently, The bug is the second request while walk into the asgi middleware. As it call the method
_start_internal_or_server_span
it will get the last request's <operation_name> http send span as its parent span, so the duplicatiion happen.We mock the middleware code to log some log like below.
Our applicaiton code is much like the below:
We have take weeks to view the source code and add logs to try fix, but it does not work. So I just put it here for recording and ask for help.
Steps to Reproduce
Unable to reproduce local, but happens on product environments.
Expected Result
different requests should not have same trace_id.
Actual Result
the second requests get the last request
asgi http send
span as it internal parent span, which make the trace_id dups.Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: