getsentry / getsentry/sentry-javascript

Provide a mechanism to override `classifyResponseStreaming` behaviour

Đang mở
#22,876 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
Cloudflare Workers Feature post-hackweek Spans
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
api, backend, cloud
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.