Repository navigation
deno: denoServeIntegration lacks the incoming request options that denoHttpIntegration has #25492
Description
Deno has two server integrations.
denoHttpIntegration covers node:http servers. denoServeIntegration covers Deno.serve, which is the native server and the one most Deno apps use.
denoServeIntegration takes only two options: maxRequestBodySize and the deprecated ignoreStatusCodes. denoHttpIntegration takes many more options for incoming requests. So a user who moves from node:http to Deno.serve loses control over what the SDK captures.
The option a user is most likely to need is ignoreRequestBody. Today a Deno.serve user can only turn body capture on or off for all routes. They cannot skip a health check, a file upload, or a route that receives secrets. Node (httpIntegration), Cloudflare (httpServerIntegration) and Deno's own denoHttpIntegration all have this option.
Proposed options
Use the same names and semantics as denoHttpIntegration. Callbacks get the web Requestinstead of a node:http IncomingMessage, which matches Cloudflare's httpServerIntegration.
| Option | Type | Default | Notes |
|---|---|---|---|
ignoreRequestBody |
(url: string, request: Request) => boolean |
none | Main ask. Skip body capture when the callback returns true. url is the full URL, as in Cloudflare. |
ignoreIncomingRequests |
(urlPath: string, request: Request) => boolean |
none | Skip the server span for a request. Errors in the handler are still captured. |
ignoreStaticAssets |
boolean |
true |
Skip spans for favicon.ico, robots.txt, *.cssand so on. Use isStaticAssetRequestfrom @sentry/core/server. Defaulting to truechanges current behavior, so it needs a changelog note. |
spans |
boolean |
hasSpansEnabled(options) |
Turn off Deno.servespans but keep error capture and request data. |
onSpanCreated |
(span: Span, request: Request) => void |
none | Runs after the server span starts. |
onSpanEnd |
(span: Span, request: Request, response: Response) => void |
none | Runs before the server span ends. With a streamed response, it runs when the stream finishes. |
Needs a decision: sessions and sessionFlushingDelayMS
denoHttpIntegration records request sessions (#22888 turned them on), but Deno.serve does not. So release health for most Deno apps shows no request sessions. The shared helper recordRequestSession in @sentry/core/server waits for a node:http response close event. Deno.serve needs a small adapter, or the helper needs a callback form. This is bigger than the other options and could be its own issue.
Implementation notes
- All the code is in
packages/deno/src/integrations/deno-serve.tsandpackages/deno/src/wrap-deno-request-handler.ts. - The wrapper already reads
maxRequestBodySizefrom the integration instance throughclient.getIntegrationByName('DenoServe'). New options can be read the same way. - Check
ignoreRequestBodyin the wrapper next to the existingrequest.method !== 'GET'check, beforecaptureBodyFromWinterCGRequest. The request body can only be read once, so the check must run before the SDK clones or reads it. - Cloudflare's
captureIncomingRequestBodyinpackages/cloudflare/src/integrations/httpServer.tsalready does this for a webRequest. Consider moving it to@sentry/coreso both runtimes share it. - Leave
ignoreStatusCodesas it is. It is deprecated, and it only works withtraceLifecycle: 'static'.
Tests
- Unit tests in
packages/deno/test/deno-serve.test.tsfor each option. - For
ignoreRequestBody, check that the event has norequest.datawhen the callback returnstrue, and that the handler can still read the body. - For
ignoreIncomingRequestsandignoreStaticAssets, check that no server span is sent and that a thrown error is still captured.
Related
Bun.serve(bunServerIntegration) has the same gap. It takes onlymaxRequestBodySize. The same option set could apply there, in the same issue or a separate one.- Deno's export surface is narrower than Cloudflare's #23896 / Deno's export surface is narrower than Cloudflare's #23896 deferred porting Cloudflare's
httpServerIntegrationto Deno. Adding these options todenoServeIntegrationgives Deno the same features without a second integration that configures the same thing.
Activity
linear-code commentedon Oct 18, 2026
JS-3955