sentry-python
sentry-python copied to clipboard
Parent/child relationship in spans from ASGI based streaming response wrong.
How do you use Sentry?
Sentry Saas (sentry.io)
Version
all
Steps to Reproduce
Run this demo application: https://github.com/antonpirker/testing-sentry/blob/main/test-fastapi-streaming-response/main.py
Expected Result
The spans created in the response generator called SPAN Stream Response Generator should be childrend of the span SPAN Streaming View.
Actual Result
The spans SPAN Stream Response Generator are children of the root and siblings to SPAN Streaming View:
Solution brain storming
This is probably related to: https://github.com/getsentry/sentry-python/pull/3798 And should also be treated the same way (with having a maximum transaction duration of 5 minutes)