getsentry / getsentry/sentry-javascript
bun: `Bun.serve` does not support streaming responses
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.7k
- Forks
- 1.8k
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 515
Descripción
`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`.
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bun, typescript
- Área
- backend, observability
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 65/100