getsentry / getsentry/sentry-javascript
bun: `Bun.serve` does not support streaming responses
- 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ả
`wrapRequestHandler` in `packages/bun/src/integrations/bunserver.ts:189` uses `startSpan`, which ends the span as soon as the handler returns. Deno (`streamResponse`) and Cloudflare (`classifyResponseStreaming` plus a `TransformStream`) both keep the span open until the body finishes.
An SSE or LLM streaming route on Bun reports a span duration covering only the handler, not the stream. This is the common shape for AI apps, which are a large part of the Bun audience.
**Work item.** Move `classifyResponseStreaming` into `@sentry/core` or `@sentry/server-utils` (see D10) and adopt it in `bunserver.ts` with `startSpanManual`.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start in packages/bun/src/integrations/bunserver.ts:189 at wrapRequestHandler and compare the Deno streamResponse and Cloudflare classifyResponseStreaming plus TransformStream implementations. Review the D10 proposal for placing classifyResponseStreaming, then verify with a streaming response that the span remains open until the body finishes rather than ending when the handler returns.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- bun, typescript
- Lĩnh vực
- backend, observability
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 65/100