Skip to content

feat(deno): Add incoming request options to denoServeIntegration - #25493

Open
isaacs wants to merge 2 commits into
isaacschlueter/js-3522-denos-export-surface-is-narrower-than-cloudflaresfrom
isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options
Open

isaacs wants to merge 2 commits into
isaacschlueter/js-3522-denos-export-surface-is-narrower-than-cloudflaresfrom
isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options

Conversation

@isaacs

@isaacs isaacs commented Oct 18, 2026

Copy link
Copy Markdown
Member

Deno.serve is the server most Deno apps use, but its integration only took maxRequestBodySize and the deprecated ignoreStatusCodes. A user could not skip body capture for one route, such as a health check, an upload, or a route that receives secrets. denoHttpIntegration, Node and Cloudflare all allow this.

denoServeIntegration now accepts ignoreRequestBody, ignoreIncomingRequests, ignoreStaticAssets, spans, onSpanCreated and onSpanEnd. They use the same names and behavior as denoHttpIntegration, but the callbacks receive the web Request.

The options follow core's node:http server code. urlPath includes the query string, and the static asset filter applies only to GET. When the SDK skips a span, it still continues the incoming trace, attaches request data and the body, and captures errors. For a streamed response, onSpanEnd runs when the stream finishes. It does not run when the handler throws, because there is no Response to pass.

Two defaults change 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.

Request sessions for Deno.serve and the same options for Bun.serve remain separate work.

Fixes #25492
Fixes JS-3955

`Deno.serve` is the server most Deno apps use, but its integration only
took `maxRequestBodySize` and the deprecated `ignoreStatusCodes`. A user
could not skip body capture for one route, such as a health check, an
upload, or a route that receives secrets. `denoHttpIntegration`, Node
and Cloudflare all allow this.

`denoServeIntegration` now accepts `ignoreRequestBody`,
`ignoreIncomingRequests`, `ignoreStaticAssets`, `spans`, `onSpanCreated`
and `onSpanEnd`. They use the same names and behavior as
`denoHttpIntegration`, but the callbacks receive the web `Request`.

The options follow core's `node:http` server code. `urlPath` includes
the query string, and the static asset filter applies only to `GET`.
When the SDK skips a span, it still continues the incoming trace,
attaches request data and the body, and captures errors. For a streamed
response, `onSpanEnd` runs when the stream finishes. It does not run
when the handler throws, because there is no `Response` to pass.

Two defaults change 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.

Request sessions for `Deno.serve` and the same options for `Bun.serve`
remain separate work.

Fixes #25492
Fixes JS-3955

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@isaacs
isaacs added this pull request to stack #25494 October 18, 2026 22:56
@isaacs
isaacs requested a review from a team as a code owner October 18, 2026 22:56
@isaacs
isaacs requested review from JPeer264 and mydea and removed request for a team October 18, 2026 22:56
@linear-code

linear-code Bot commented Oct 18, 2026

Copy link
Copy Markdown

JS-3955

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit de6e43c. Configure here.

Comment thread packages/deno/src/utils/streaming.ts
Comment thread packages/deno/test/deno-serve.test.ts Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deno: denoServeIntegration lacks the incoming request options that denoHttpIntegration has

1 participant