-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix spans for streaming responses in WSGI based frameworks (#3798)
Fixes spans in streaming responses when using WSGI based frameworks. Only close the transaction once the response was consumed. This way all the spans created during creation of the response will be recorded with the transaction: - The transaction stays open until all the streaming blocks are sent to the client. (because of this I had to update the tests, to make sure the tests, consume the response, because the Werkzeug test client (used by Flask and Django and our Strawberry tests) will not close the WSGI response) - A maximum runtime of 5 minutes for transactions is enforced. (like Javascript does it) - When using a generator to generate the streaming response, it uses the correct scopes to have correct parent-child relationship of spans created in the generator. People having Sentry in a streaming application will: - See an increase in their transaction duration to up to 5 minutes - Get the correct span tree for streaming responses generated by a generator Fixes #3736
- Loading branch information
1 parent
a7c2d70
commit da20623
Showing
6 changed files
with
270 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.