You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a mechanism to override classifyResponseStreaming behaviour #22876
I have a React RSC application that is streaming responses, and classifyResponseStreaming does not correctly detect the HTTP response as a stream because it is limited to only a few content types. I would like to be able to override the detection behaviour so I can avoid spans ending early.
It would be ideal if the Sentry SDK had an optional callback that could be set to inspect a response and return whether or not the response is streaming.
I have a React RSC application that is streaming responses
I assume it is streaming the RSC or other responses? Which content types were you thinking about? Not sure if adding an option is the best scenario for it.
@JPeer264 It's streaming RSC and SSR responses. The content types in our case are text/x-component;charset=utf-8 and text/html;charset=utf-8.
SSR is harder to auto-detect because it's text/html. If you don't want to add an option, an alternative could be for Sentry to detect the presence of a custom e.g. x-streaming: true header, we could add that to the responses we know are streaming.
Is text/x-component something you set or is this a standard/set by some framework/library that we should cover?
does your text/html response have a content-length header? We already check for test/plain && !contentLength, so maybe we could extend this with text/html.
What I'm trying to determine is if there's an established pattern we're missing or if this is custom and we should provide this override mechanism as you suggested.
@hach-que sorry that it took so long. In the next release you can use the new option isStreamingResponse and decide which is streaming and which isn't. It will be documented soon too
Activity
linear-code commentedon Jul 30, 2026
JS-3236
JPeer264 commentedon Jul 31, 2026
Hey thanks for the issue.
I assume it is streaming the RSC or other responses? Which content types were you thinking about? Not sure if adding an option is the best scenario for it.
hach-que commentedon Jul 31, 2026
@JPeer264 It's streaming RSC and SSR responses. The content types in our case are
text/x-component;charset=utf-8andtext/html;charset=utf-8.SSR is harder to auto-detect because it's
text/html. If you don't want to add an option, an alternative could be for Sentry to detect the presence of a custom e.g.x-streaming: trueheader, we could add that to the responses we know are streaming.Lms24 commentedon Aug 3, 2026
@hach-que
text/x-componentsomething you set or is this a standard/set by some framework/library that we should cover?text/htmlresponse have acontent-lengthheader? We already check fortest/plain && !contentLength, so maybe we could extend this withtext/html.What I'm trying to determine is if there's an established pattern we're missing or if this is custom and we should provide this override mechanism as you suggested.
8 remaining items
andreiborza commentedon Aug 17, 2026
Hi @hach-que, we are currently on a company-wide hackweek and will get back to issue triaging August 24th. We'll take another look then.
feat(cloudflare): Add `isStreamingResponse` option and detect streame…
JPeer264 commentedon Oct 19, 2026
@hach-que sorry that it took so long. In the next release you can use the new option
isStreamingResponseand decide which is streaming and which isn't. It will be documented soon toogithub-actions commentedon Oct 23, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #24932, which was included in the 11.9.0 release.