-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Django StreamingHttpResponse View not working as expected #3736
Comments
Do we have a way to set the trace_id? But it seems that we don't have a set_trace_id thing at transaction/event level, right? I know that we can do a Span(trace_id=myid), but passing this to ALL calls downstream is bad. 😅 |
Hey @marcoaleixo thanks for raising this, I will have a look! |
Indeed! I have now reproduced this with this demo application: The first span |
This is a bug. I guess it has something to do with how Django handles streaming views and what we monkey patch in Django. Sentry is probably not patching the functions in Django that are handling the streaming responses. |
hey @antonpirker - thanks for taking a look but I have a quick question: how do you prioritize those fixes? Just to understand if I will need to use another observability tool until you fix this. |
Hey! I will have some time today and tomorrow to look at this. I will keep you posted on the progress |
Small update: The problem is that |
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.18.0
Steps to Reproduce
Here the span.trace_id will be for instance "1234"
In this function, the trace_id will be totally different.
I think that this is related the StreamingHttpResponse, because the Sentry is working fine for all my other views.
Feel free to ask more details to help in the investigation.
FROM python:3.9.18-slim-bullseye
Django==4.1
djangorestframework==3.14
I'm executing my server with python manage.py runserver 0.0.0.0:8000
In production we use something like gunicorn api.wsgi -b 0.0.0.0:8081
Expected Result
The trace_id should stay the same in StreamingHttpResponse views and underlying function calls.
Actual Result
The trace_id is different between the view and underlying function calls.
The text was updated successfully, but these errors were encountered: