getsentry / getsentry/sentry-javascript

Provide a mechanism to override `classifyResponseStreaming` behaviour

Offen
#22,876 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Cloudflare Workers Feature post-hackweek Spans
Vorherrschende Sprache
TypeScript
Sterne
8.7k
Forks
1.8k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
515

Beschreibung

### 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_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start in packages/cloudflare/src/request.ts at classifyResponseStreaming and trace its callers to understand how the current content-type checks affect span completion. Define how an optional response-inspection callback should override the built-in classification, then verify that custom streaming responses keep their spans open until streaming finishes.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
api, backend, cloud
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.