Skip to content

feat(deno)!: Align remaining denoHttpIntegration options with httpIntegration - #23692

Merged
RulaKhaled merged 5 commits into
developfrom
rolaabuhasna/js-3393-align-remaining-denohttp-options
Aug 31, 2026
Merged

feat(deno)!: Align remaining denoHttpIntegration options with httpIntegration#23692
RulaKhaled merged 5 commits into
developfrom
rolaabuhasna/js-3393-align-remaining-denohttp-options

Conversation

@RulaKhaled

@RulaKhaled RulaKhaled commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #23313, which aligned most of denoHttpIntegration's option names with httpIntegration.

Outgoing request hooks

outgoingRequestHook, outgoingResponseHook and outgoingRequestApplyCustomAttributes are now declared on denoHttpIntegration. Core already invoked all three and Deno already spread its options through, so they fired at runtime and were only unreachable from TypeScript. The last one maps to core's applyCustomAttributesOnSpan, the same way tracePropagation maps to core's option name.

ignoreStatusCodes

This was declared on the shared HttpInstrumentationOptions contract but read by nobody in core — only Node implemented it, in its own processEvent. The filtering helper and default list now live in @sentry/core, Node uses them instead of its private copy, and denoHttpIntegration gained a processEvent that applies them.

Behavior change: With traceLifecycle: 'static', Deno now drops server transactions with status codes in [[401, 404], [301, 303], [305, 399]] by default. That is the server-SDK default for traceIgnoreStatusCodes: incoming requests that are useless for debugging (bot 404s, unhelpful redirects) should not consume span quota. Node already used this list; Bun gets it via httpIntegration.

The filter runs in processEvent on transaction events. The default 'stream' lifecycle does not produce those events, so typical Deno apps are unaffected — the same limitation Node already has.

Since denoHttpIntegration is a default integration and filters on the finished transaction rather than on its origin, this covers Deno.serve transactions too (when transaction events are produced). Pass ignoreStatusCodes: [] to keep everything. Documented in MIGRATION.md.

Kept transactions now also carry the HTTP status in the top-level response context, as in Node.

Closes #23481

@linear-code

linear-code Bot commented Aug 27, 2026

Copy link
Copy Markdown

JS-3393

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.56 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.76 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.78 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.69 kB - -
@sentry/browser (incl. Tracing, Replay) 88.24 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.63 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.94 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.86 kB - -
@sentry/browser (incl. Feedback) 46.05 kB - -
@sentry/browser (incl. sendFeedback) 33.62 kB - -
@sentry/browser (incl. FeedbackAsync) 38.73 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.3 kB - -
@sentry/react (incl. Tracing) 50.95 kB - -
@sentry/vue 35.73 kB - -
@sentry/vue (incl. Tracing) 51.03 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.35 kB - -
CDN Bundle (incl. Tracing) 49.39 kB - -
CDN Bundle (incl. Logs, Metrics) 32.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.26 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB - -
CDN Bundle (incl. Tracing, Replay) 86.87 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.73 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.65 kB - -
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.22 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.91 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.71 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.08 kB - -
@sentry/nextjs (client) 53.52 kB - -
@sentry/sveltekit (client) 49.2 kB - -
@sentry/core/server 65.67 kB +0.31% +198 B 🔺
@sentry/core/browser 51.86 kB - -
@sentry/node 123.47 kB +0.03% +29 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.23 kB - -
@sentry/node - without tracing 87.76 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 103.15 kB +0.04% +41 B 🔺
@sentry/aws-serverless 96.09 kB +0.06% +49 B 🔺
@sentry/cloudflare (withSentry) - minified 200.72 kB - -
@sentry/cloudflare (withSentry) 499.25 kB - -

View base workflow run

@RulaKhaled
RulaKhaled requested a review from isaacs August 27, 2026 16:27

return {
name: INTEGRATION_NAME,
processEvent(event: Event): Event | null {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The filter is processEvent on the finished transaction, not which integration created the span. So on Deno this also drops Deno.serve 404s/3xx, not only node:http. Same side effect Bun already has.

Are we good applying that Node default to Deno including Deno.serve (align with Node/Bun/spec), or should WinterCG handlers stay unfiltered?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's a weirder aspect to this, I think.

As of this change, the ignoreStatusCodes option is applied to all transaction events that have the status code field, including those from Deno.serve, like you mention. But, the option is only configured on the DenoHttp integration, which the user might not even be using.

So, to filter out 3xx responses from your Deno.serve integration, you have to enable the node:http integration and set the option there. Feels like spooky action at a distance.

I'd recommend keep this where it is is, but add the same ignoreStatusCodes option to DenoServeIntegrationOptions and have denoServeIntegration do its own filtering, and gate both on span origin, so each integration owns its own option that's not cross-talking.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done! each integration now gates on its own span origin, so denoHttpIntegration and denoServeIntegration no longer filter each other's transactions. Defaults unchanged on both paths. Also worth flagging, denoHttpIntegration is a default integration, so there was never anything to opt into, the option just didn't advertise its reach, which was the real smell.

btw Node and Bun have the same cross-talk today 🤔 I'll open a follow up to look into that. This behaviour seems the cleanest.

RulaKhaled and others added 2 commits August 28, 2026 14:44
…egration

Follow-up to #23313. Declares the outgoing request hooks on
denoHttpIntegration, and makes `ignoreStatusCodes` actually take effect
there by sharing the status-code filtering with Node via @sentry/core.
Keep shouldFilterStatusCode private to the module, and document that Deno's
status-code filter runs on the finished transaction, including Deno.serve.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
@RulaKhaled
RulaKhaled force-pushed the rolaabuhasna/js-3393-align-remaining-denohttp-options branch from 2c0c440 to a380532 Compare August 28, 2026 12:45
@RulaKhaled
RulaKhaled marked this pull request as ready for review August 28, 2026 13:02
@RulaKhaled
RulaKhaled requested review from a team as code owners August 28, 2026 13:02
@RulaKhaled
RulaKhaled requested review from andreiborza and removed request for a team August 28, 2026 13:02

@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 a380532. Configure here.

Comment thread packages/deno/src/integrations/http.ts
Comment thread packages/deno/test/deno-http-outgoing-hooks.test.ts Outdated
The filter only runs on transaction events, so MIGRATION.md and the Deno
JSDoc should say so. Also wait for the parent transaction in the
outgoing-hooks test instead of racing beforeSendTransaction.

Co-Authored-By: Cursor <cursoragent@cursor.com>

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the status code filtering stuff can be improved a bit to not have cross-talk between integrations, but to be honest, since it's static tracing only and not streaming, it's kind of short-lived and only on the legacy path anyway.

Some other nits, but for the most part LGTM.

/**
* A hook that can be used to mutate the span one last time when the response is finished.
*/
onSpanEnd?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be added to the Node HTTP options? I think that's the only remaining option that's in one and not the other, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yah it's the only one left, I contemplated adding it, onSpanCreated gives you the live response, so res.on('finish', …) covers it, easy to add later if someone wants the convenience


return {
name: INTEGRATION_NAME,
processEvent(event: Event): Event | null {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's a weirder aspect to this, I think.

As of this change, the ignoreStatusCodes option is applied to all transaction events that have the status code field, including those from Deno.serve, like you mention. But, the option is only configured on the DenoHttp integration, which the user might not even be using.

So, to filter out 3xx responses from your Deno.serve integration, you have to enable the node:http integration and set the option there. Feels like spooky action at a distance.

I'd recommend keep this where it is is, but add the same ignoreStatusCodes option to DenoServeIntegrationOptions and have denoServeIntegration do its own filtering, and gate both on span origin, so each integration owns its own option that's not cross-talking.

Comment thread packages/core/src/integrations/http/types.ts Outdated
Comment thread packages/deno/test/deno-http-outgoing-hooks.test.ts Outdated
Comment thread packages/deno/test/deno-http.test.ts Outdated
RulaKhaled and others added 2 commits August 31, 2026 11:54
`processHttpServerTransactionEvent` takes an optional span origin.
`denoHttpIntegration` gates on `auto.http.server` and `denoServeIntegration`
gains its own `ignoreStatusCodes` gated on `auto.http.deno`, so neither
filters the other's transactions. Node and Bun pass no origin and are
unchanged.

Also drops the unread `ignoreStatusCodes` declaration from core's
`HttpInstrumentationOptions`, and fixes the `///` reference directives.
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
@RulaKhaled
RulaKhaled merged commit 3519e74 into develop Aug 31, 2026
552 of 555 checks passed
@RulaKhaled
RulaKhaled deleted the rolaabuhasna/js-3393-align-remaining-denohttp-options branch August 31, 2026 11:03
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.

Align remaining denoHttpIntegration options with httpIntegration

2 participants