Document incoming request options and Cloudflare channel integrations for the server SDKs
Maintainer antworten meist innerhalb von 1 Tag
@isaacs arbeitet bereits daran.
Seit 29.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Background
A stack of changes in getsentry/sentry-javascript aligns the incoming HTTP request options and the exports of the Node, Bun, Deno and Cloudflare SDKs. Tracking issue: getsentry/sentry-javascript#25538. Several changes need docs. The SDK issues are listed with each section. The SDK PRs are not merged yet, so check the released version before you publish.
The main docs change is section 1 (Cloudflare channel integrations). Sections 2 to 5 cover the other user-facing changes in the same stack.
1. Cloudflare: configure channel integrations
SDK issue: getsentry/sentry-javascript#25575
What changed
The @sentry/cloudflare/vite plugin instruments supported packages at build time (for example pg, mysql2, redis, openai, @anthropic-ai/sdk, @langchain/*, express, hono). When the plugin bundles one of these packages, the SDK adds the matching integration automatically, with its default options.
Before, users could not set options on these integrations, because @sentry/cloudflare did not export them. Now it exports them, so users can pass a configured instance in integrations. The configured instance replaces the default one.
Exported integrations: amqplibIntegration, anthropicAIIntegration, awsIntegration, dataloaderIntegration, expressIntegration, firebaseIntegration, genericPoolIntegration,googleGenAIIntegration, graphqlIntegration, groqIntegration, hapiIntegration, kafkaIntegration, knexIntegration, koaIntegration, langChainIntegration, langGraphIntegration, lruMemoizerIntegration, mastraIntegration, mcpServerIntegration,mistralAIIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, neonIntegration, nitroIntegration, openAIIntegration, piDurableIntegration, postgresIntegration, postgresJsIntegration, redisIntegration,tediousIntegration, togetherAIIntegration, typesafeIntegration, and SentryMastraExporter. (honoIntegration, prismaIntegration and vercelAIIntegration were already exported.)
The options are the same as in the Node SDK. The most important case is the AI integrations: users can now turn off prompt and response capture on Cloudflare.
import * as Sentry from '@sentry/cloudflare';
export default Sentry.withSentry(
env => ({
dsn: env.SENTRY_DSN,
integrations: [Sentry.openAIIntegration({ recordInputs: false, recordOutputs: false })],
}),
handler,
);
Requirement to state clearly
These integrations get data only when the @sentry/cloudflare/vite plugin is in the Vite config. Without the plugin, an integration in integrations records nothing. With debug: true, the SDK logs a warning that names the integration and the plugin.
Importing an integration does not add code for the others. A worker bundles only the integrations it imports.
Suggested docs changes
- Cloudflare platform docs, on the page or section about the Vite plugin and build-time instrumentation: explain that the plugin adds these integrations automatically, and how to configure one by passing it in
integrations. Use the example above. - Each integration page under the JavaScript integrations docs that lists supported SDKs: add Cloudflare where the integration is now exported, with a note that it needs the Vite plugin. Check the AI integration pages first (OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, Mistral, Groq, Together AI), because users most need their
recordInputs/recordOutputsoptions.
2. Bun: bunServerIntegration options and request sessions
SDK issue: getsentry/sentry-javascript#25571
bunServerIntegration (instruments Bun.serve) now accepts:
| Option | Default | Meaning |
|---|---|---|
maxRequestBodySize |
'medium' |
Existing option. Max size of request bodies attached to events. |
ignoreRequestBody |
none | (url, request: Request) => boolean. Skip body capture when it returns true. If it throws, the body is skipped. |
ignoreIncomingRequests |
none | (urlPath, request: Request) => boolean. Skip the span when it returns true. urlPath includes the query string. Errors are still captured. |
ignoreStaticAssets |
true |
Skip spans for GET requests to static assets such as favicon.ico, robots.txt or *.js. |
spans |
client tracing config | Whether to create spans. Errors and request data are still captured when false. |
onSpanCreated |
none | (span, request: Request) => void. Runs after the span starts, before the handler. |
onSpanEnd |
none | (span, request: Request, response: Response) => void. Runs before the span ends. For a streamed response, when the stream finishes. Not called when the handler throws. |
sessions |
true |
Record a request session for each request (release health). Needs release. |
sessionFlushingDelayMS |
60000 |
Delay before the session aggregate is sent. |
Behavior changes to mention: static asset requests no longer create spans by default, no spans when tracing is disabled, and errors thrown for OPTIONS and HEAD requests are now captured.
These options match denoServeIntegration in the Deno SDK. If the Deno docs already describe those options, the Bun docs can follow the same structure.
3. Cloudflare: httpServerIntegration span options
SDK issue: getsentry/sentry-javascript#25573
Cloudflare's httpServerIntegration had only maxRequestBodySize and ignoreRequestBody. It now also accepts ignoreIncomingRequests, ignoreStaticAssets (default true), spans (defaults to the client tracing config), onSpanCreated and onSpanEnd, with the same meaning as in the Bun table above. The callbacks receive the web Request and Response.
Cloudflare does not support sessions or sessionFlushingDelayMS. A worker has no long-lived process to run the timer that sends session aggregates.
Behavior changes to mention: static asset requests no longer create spans by default, and no request spans when tracing is disabled. If ignoreRequestBody throws, the request no longer fails, and the body is skipped.
4. Node: onSpanEnd on httpIntegration
SDK issue: getsentry/sentry-javascript#25572
httpIntegration (and httpServerSpansIntegration) now accept onSpanEnd: (span, request, response) => void. It runs when the response for an incoming request finishes, after the SDK sets the response status on the span, before the span ends. request is the IncomingMessage and response the ServerResponse. Add it next to onSpanCreated in the httpIntegration options docs. Bun re-exports Node's httpIntegration, so it applies there too.
Also in httpIntegration: the request argument of ignoreRequestBody is now typed as the incoming IncomingMessage, which is what the SDK always passed. If the docs say it is a RequestOptions object, correct that.
5. New exports (only where the docs list exports)
SDK issue: getsentry/sentry-javascript#25574
- Node and Bun now export
moduleMetadataIntegration,instrumentPostgresJsSql,instrumentCreateReactAgentandawsIntegration. - Deno and Cloudflare now export
parameterizeandinstrumentStateGraphCompile. - Deno now exports
fastifyIntegration.
Update any "supported SDKs" lists on the pages for these APIs.
Done when
- The Cloudflare docs explain how to configure an integration that the Vite plugin adds, with the requirement that the plugin is present.
- The AI integration pages show Cloudflare as supported, with the Vite plugin note.
- The Bun and Cloudflare request integration docs list the new options and the default changes.
- The Node
httpIntegrationdocs listonSpanEnd.
- Vorherrschende Sprache
- MDX
- Sterne
- 451
- Forks
- 1.7k
- Ø Merge
- 1 T. 10 Std.
- Gemergte PRs (30 T.)
- 566
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-docs
-
Docs Product
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
getsentry/sentry-docs#20849 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Vanta EU integration not available anymoreEvtl. vergeben @sansynx hat das vor 51 Tagen übernommen. OffenDocs Product
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
getsentry/sentry-docs#19757 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Document Android network-event breadcrumb configurationEvtl. vergeben @sansynx hat das vor 67 Tagen übernommen. OffenDocs Platform: Android SDKs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
getsentry/sentry-docs#19438 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Unused import OpenAIIntegration on Pydantic AI integration pageEvtl. vergeben @minutechreview hat das vor 59 Tagen übernommen. OffenDocs Platform: Python SDKs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
getsentry/sentry-docs#19432 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs Product
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 68/100
getsentry/sentry-docs#19028 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag