Skip to content

Provide a mechanism to override classifyResponseStreaming behaviour #22876

Closed

Description

@hach-que

Problem Statement

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.

https://github.com/getsentry/sentry-javascript/blob/develop/packages/cloudflare/src/request.ts#L146

Solution Brainstorm

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.

Additional Context

No response

Priority

No response

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 30, 2026
  2. linear-code commented on Jul 30, 2026

    @linear-code
  3. JPeer264 commented on Jul 31, 2026

    @JPeer264
    Member

    Hey thanks for the issue.

    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.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 31, 2026
  5. hach-que commented on Jul 31, 2026

    @hach-que
    Author

    @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.

  6. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 31, 2026
  7. Lms24 commented on Aug 3, 2026

    @Lms24
    Member

    @hach-que

    1. Is text/x-component something you set or is this a standard/set by some framework/library that we should cover?
    2. 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.

  8. 8 remaining items

  9. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Aug 17, 2026
  10. andreiborza commented on Aug 17, 2026

    @andreiborza
    Member

    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.

  11. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Aug 17, 2026
  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 30, 2026
  13. added a commit that references this issue on Oct 19, 2026
    d6c8d82
  14. JPeer264 commented on Oct 19, 2026

    @JPeer264
    Member

    @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

  15. github-actions commented on Oct 23, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions