Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/platforms/javascript/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,28 @@ Propagation over `stub.fetch()` and service binding `fetch()` uses HTTP headers,

</SdkOption>

<SdkOption name="isStreamingResponse" type='(response: Response, request: Request) => boolean | undefined' availableSince='11.9.0'>

Overrides whether Sentry treats a `fetch` response as streaming. Use this if your application streams responses, such as HTML rendered with streaming SSR, that Sentry doesn't detect automatically.

Return `true` to keep the request span open until streaming completes, `false` to end it when the handler returns, or `undefined` to use automatic detection.

```typescript {filename:instrument.server.ts}
import { defineCloudflareOptions } from "@sentry/cloudflare";

export default defineCloudflareOptions((env) => ({
dsn: env.SENTRY_DSN,
isStreamingResponse: (response) =>
response.headers.get("content-type")?.startsWith("text/html")
? true
: undefined,
}));
```

The callback receives the response and request. It must be synchronous and must not read the response body.

</SdkOption>

</PlatformSection>

<SdkOption name="strictTraceContinuation" type='boolean' defaultValue='false' categorySupported={["server", "serverless"]}>
Expand Down
Loading