Skip to content

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

Merged
isaacs merged 4 commits into
developfrom
isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options
Oct 19, 2026
Merged

isaacs merged 4 commits into
developfrom
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

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/deno/src/utils/streaming.ts
Comment thread packages/deno/test/deno-serve.test.ts Outdated
@isaacs
isaacs requested review from a team as code owners October 19, 2026 16:47
@isaacs
isaacs requested review from logaretm and s1gr1d and removed request for a team October 19, 2026 16:47
@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

This PR is too large for Bugbot to review. It changes 75,966 lines and 3,735,756 characters. Split the change into smaller pull requests to get a review.

@isaacs
isaacs force-pushed the isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options branch from 096f910 to 334851d Compare October 19, 2026 16:57
@isaacs
isaacs force-pushed the isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options branch from 334851d to bbc79aa Compare October 19, 2026 17:41

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/deno/test/streaming.test.ts
Base automatically changed from isaacschlueter/js-3522-denos-export-surface-is-narrower-than-cloudflares to develop October 19, 2026 18:49
@isaacs
isaacs force-pushed the isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options branch from 4defd67 to f7e6b65 Compare October 19, 2026 18:50

@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 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit f7e6b65. Configure here.

Comment thread packages/deno/src/wrap-deno-request-handler.ts
isaacs and others added 4 commits October 19, 2026 12:06
`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 force-pushed the isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options branch from 258afa8 to 9b230da Compare October 19, 2026 19:06
@isaacs
isaacs merged commit 4d19e60 into develop Oct 19, 2026
87 checks passed
@isaacs
isaacs deleted the isaacschlueter/js-3955-deno-denoserveintegration-lacks-the-incoming-request-options branch October 19, 2026 20:07
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

2 participants