scout_apm_python
scout_apm_python copied to clipboard
Correctly instrument streaming responses
Django (StreamingHttpResponse) and other frameworks support streaming HTTP responses. Currently our middleware-based instrumentation will not capture all the time sent streaming the response out, but instead prematurely close the TrackedRequest.
To correctly capture such responses we'd want to detect them and change behaviour to only close the TrackedRequest once their iteration has completed.