getsentry / getsentry/sentry-javascript
bun: `Bun.serve` does not support streaming responses
- Linguagem predominante
- TypeScript
- Estrelas
- 8.7k
- Forks
- 1.8k
- Merge médio
- 1d 18h
- PRs com merge (30d)
- 541
Descrição
`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`.
Guia de contribuição
Direção de pesquisa
Comece em packages/bun/src/integrations/bunserver.ts:189, em wrapRequestHandler, e compare as implementações de Deno streamResponse e Cloudflare classifyResponseStreaming e TransformStream. Revise a proposta D10 para posicionar classifyResponseStreaming e, em seguida, verifique com uma resposta em streaming se o span permanece aberto até o término do body, em vez de terminar quando o handler retorna.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- bun, typescript
- Domínio
- backend, observability
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 65/100