Repository navigation
feat(cloudflare): Add incoming request span options to httpServerIntegration - #25582
Open
Conversation
isaacs
added this pull request to stack #25589
October 20, 2026 22:30
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f8fed4d. Configure here.
Contributor
size-limit report 📦
|
isaacs
marked this pull request as ready for review
October 21, 2026 00:35
isaacs
requested review from
JPeer264 and
mydea
and removed request for
a team
October 21, 2026 00:35
isaacs
force-pushed
the
isaacschlueter/js-3971-cloudflare-add-ignoreincomingrequests-ignorestaticassets
branch
from
October 21, 2026 01:07
97cb62a to
a96f52e
Compare
isaacs
force-pushed
the
isaacschlueter/js-3971-cloudflare-add-ignoreincomingrequests-ignorestaticassets
branch
from
October 21, 2026 01:12
a96f52e to
2ceb825
Compare
…egration` Cloudflare's `httpServerIntegration` took only the body capture options. A user could not skip spans for one route, such as a health check, or change the request span from the request or the response. Node, Deno and Bun all allow this. `httpServerIntegration` now accepts `ignoreIncomingRequests`, `ignoreStaticAssets`, `spans`, `onSpanCreated` and `onSpanEnd`. They use the same names and behavior as `denoServeIntegration` and `bunServerIntegration`, and the callbacks receive the web `Request`. The shared `ServerRequestOptions` check for Cloudflare now lists only the session options, which a worker cannot support because it has no long-lived process to run the flush timer. When the SDK skips the span, it still continues the incoming trace, attaches request data and the body, and captures errors. It also still waits for a streamed response to finish before it flushes. For a streamed response, `onSpanEnd` runs when the stream finishes. It does not run when the handler throws. A callback that throws does not fail the request. `ignoreRequestBody` also no longer fails the request when it throws. The SDK skips the body instead, so it cannot leak data that the filter was meant to hide. Deno and Bun already do this. 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 SDK no longer starts request spans when tracing is disabled. Fixes #25573 Fixes JS-3971 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isaacs
force-pushed
the
isaacschlueter/js-3971-cloudflare-add-ignoreincomingrequests-ignorestaticassets
branch
from
October 21, 2026 01:15
2ceb825 to
227d2e4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Cloudflare's
httpServerIntegrationtook only the body capture options. A user could not skip spans for one route, such as a health check, or change the request span from the request or the response. Node, Deno and Bun all allow this.httpServerIntegrationnow acceptsignoreIncomingRequests,ignoreStaticAssets,spans,onSpanCreatedandonSpanEnd. They use the same names and behavior asdenoServeIntegrationandbunServerIntegration, and the callbacks receive the webRequest. The sharedServerRequestOptionscheck for Cloudflare now lists only the session options, which a worker cannot support because it has no long-lived process to run the flush timer.When the SDK skips the span, it still continues the incoming trace, attaches request data and the body, and captures errors. It also still waits for a streamed response to finish before it flushes. For a streamed response,
onSpanEndruns when the stream finishes. It does not run when the handler throws. A callback that throws does not fail the request.ignoreRequestBodyalso no longer fails the request when it throws. The SDK skips the body instead, so it cannot leak data that the filter was meant to hide. Deno and Bun already do this.Two defaults change behavior:
ignoreStaticAssetsdefaults totrue, soGETrequests for files such asfavicon.icoor*.jsno longer create spans.spansdefaults to the client's tracing configuration, so the SDK no longer starts request spans when tracing is disabled.Fixes #25573
Fixes JS-3971