You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ff5ddbf
Browse filesBrowse the repository at this point in the historyBrowse files
feat(bun): Add incoming request options and sessions to bunServerIntegration
`Bun.serve` took only `maxRequestBodySize`. A user could not skip body
capture or spans for one route, and release health showed no request
sessions or crash-free rate for `Bun.serve` apps. `denoServeIntegration`
got these in #25493 and #25496.
`bunServerIntegration` now accepts `ignoreRequestBody`,
`ignoreIncomingRequests`, `ignoreStaticAssets`, `spans`,
`onSpanCreated`, `onSpanEnd`, `sessions` and `sessionFlushingDelayMS`.
They use the same names and behavior as `denoServeIntegration`, and the
callbacks receive the web `Request`. The shared `ServerRequestOptions`
check for `Bun.serve` now lists no unsupported options.
When the SDK skips the span, it still continues the incoming trace,
attaches request data and the body, records the session and captures
errors. For a streamed response, `onSpanEnd` and the session end when
the stream finishes. A user callback that throws does not fail the
request. If `ignoreRequestBody` throws, the SDK skips the body, so it
cannot leak data that the filter was meant to hide.
Three changes in behavior:
- `ignoreStaticAssets` defaults to `true`, so `GET` requests for files
such as `favicon.ico` or `*.js` no longer create spans.
- `spans` defaults to the client's tracing configuration, so the
integration no longer starts spans when tracing is disabled.
- Errors thrown for `OPTIONS` and `HEAD` requests are now captured.
These requests also record sessions, as on Node and Deno.
Fixes#25571
Fixes JS-3969
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,14 @@ Work in this release was contributed by @adityareddy-dev, @jpdefo, @Jxxunnn, @ph
51
51
52
52
`denoServeIntegration` now records a request session for each incoming request, as `denoHttpIntegration` does for `node:http`. This gives release health and crash-free rates for `Deno.serve` apps. Sessions are sent only when a `release` is set. To turn them off, set `denoServeIntegration({ sessions: false })`. `sessionFlushingDelayMS` sets how long the SDK waits before it sends the session aggregate.
53
53
54
+
- **feat(bun): Add incoming request options and request sessions to `bunServerIntegration`**
55
+
56
+
`bunServerIntegration` now accepts the same options as `denoServeIntegration`: `ignoreRequestBody`, `ignoreIncomingRequests`, `ignoreStaticAssets`, `spans`, `onSpanCreated`, `onSpanEnd`, `sessions` and `sessionFlushingDelayMS`. The callbacks receive the web `Request`.
57
+
58
+
`Bun.serve` now records a request session for each incoming request. Sessions are sent only when a `release` is set. To turn them off, set `bunServerIntegration({ sessions: false })`.
59
+
60
+
`ignoreStaticAssets` defaults to `true`, so `Bun.serve` no longer creates spans for `GET` requests to common static assets such as `favicon.ico`, `robots.txt` or `*.js` files. To keep these spans, set `bunServerIntegration({ ignoreStaticAssets: false })`. `Bun.serve` spans also follow the client's tracing configuration by default, so the integration does not start spans when tracing is disabled. Errors thrown for `OPTIONS` and `HEAD` requests are now captured.
0 commit comments