getsentry / getsentry/sentry-javascript
Provide a mechanism to override `classifyResponseStreaming` behaviour
- 主要语言
- TypeScript
- 星标
- 8.7k
- 派生
- 1.8k
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 515
描述
### 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_
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react, typescript
- 领域
- api, backend, cloud
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100