scout_apm_python icon indicating copy to clipboard operation
scout_apm_python copied to clipboard

Correctly instrument streaming responses

Open adamchainz opened this issue 4 years ago • 0 comments

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.

adamchainz avatar Feb 10 '21 14:02 adamchainz