GeezerVison is showing github.com — feat(node,bun,deno): Answer managed tunnel requests in the runtime by logaretm · Pull Request #25998 · getsentry/sentry-javascript
Conversation
logaretm
commented
Nov 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This PR actually delivers the approach outlined in #25997 by hooking up the new utilities and wiring them up to the runtimes appropriately.
The implementation introduces a new integration factory that creates an integration for each runtime, it accepts a runtime-specific server patcher, and it applies the HTTP patch itself.
For Node.js / http module
For Node, and other runtimes that emit the http module's diagnostic channel, we patch the server emit and handle the request before it ever hits the user application.
For Deno / Bun
It does the same thing as in Node, but also adds a *.serve patch in-case the user is using the native runtime servers.
Note for reviewers: if you are lacking context on this PR, check #25997
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
Compared: 46cffcf (PR test merge using develop at 31201fb)
Against: 2f26678 (develop) · base run #65292
⚠️ Baseline mismatch: 17 develop commit(s) in the PR build are missing from the baseline. Their size changes also affect this comparison. Compare commits. Re-run once develop's baseline build for 31201fb finishes.
| Path |
Size |
% Change |
Change |
| @sentry/browser |
29.92 kB |
- |
- |
| @sentry/browser - with treeshaking flags |
28.08 kB |
- |
- |
| @sentry/browser - with treeshaking flags tracing without tracing |
27.97 kB |
- |
- |
| @sentry/browser (incl. Tracing) |
52.2 kB |
- |
- |
| @sentry/browser (incl. Tracing + Span Streaming) |
52.22 kB |
- |
- |
| @sentry/browser (incl. Tracing, Profiling) |
55.18 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) |
92.52 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
81.2 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
97.25 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
110.25 kB |
- |
- |
| @sentry/browser (incl. Feedback) |
47.52 kB |
- |
- |
| @sentry/browser (incl. sendFeedback) |
35.02 kB |
- |
- |
| @sentry/browser (incl. FeedbackAsync) |
40.13 kB |
- |
- |
| @sentry/browser (incl. Metrics) |
31.48 kB |
- |
- |
| @sentry/browser (incl. Logs) |
31.77 kB |
- |
- |
| @sentry/browser (incl. Metrics & Logs) |
32.45 kB |
- |
- |
| @sentry/react |
31.78 kB |
- |
- |
| @sentry/react (incl. Tracing) |
54.62 kB |
- |
- |
| @sentry/vue |
38.24 kB |
- |
- |
| @sentry/vue (incl. Tracing) |
55.24 kB |
- |
- |
| @sentry/svelte |
29.95 kB |
- |
- |
| @sentry/remix (Remix 3 client bundle) |
57.83 kB |
- |
- |
| CDN Bundle |
31.72 kB |
- |
- |
| CDN Bundle (incl. Tracing) |
52.81 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) |
34.52 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) |
55.32 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) |
75.9 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) |
90.98 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) |
93.54 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
97.11 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) |
99.71 kB |
- |
- |
| CDN Bundle - uncompressed |
92.76 kB |
- |
- |
| CDN Bundle (incl. Tracing) - uncompressed |
155.77 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) - uncompressed |
101.29 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed |
163.55 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed |
232.85 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
277.46 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed |
285.23 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
291.17 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed |
298.92 kB |
- |
- |
| @sentry/nextjs (client) |
57.64 kB |
- |
- |
| @sentry/sveltekit (client) |
52.73 kB |
- |
- |
| @sentry/core/server |
44.17 kB |
+0.81% |
+354 B 🔺 |
| @sentry/core/browser |
13.93 kB |
- |
- |
| @sentry/node |
157.07 kB |
+0.22% |
+342 B 🔺 |
| @sentry/node/import (ESM hook with diagnostics-channel injection) |
82.28 kB |
- |
- |
| @sentry/node - without tracing |
96.92 kB |
+0.34% |
+323 B 🔺 |
| @sentry/node - without channel injection |
137.36 kB |
+0.24% |
+317 B 🔺 |
| @sentry/aws-serverless |
105.56 kB |
+0.29% |
+298 B 🔺 |
| @sentry/cloudflare (withSentry) - minified |
200.99 kB |
+0.45% |
+895 B 🔺 |
| @sentry/cloudflare (withSentry) |
498.92 kB |
+0.37% |
+1.82 kB 🔺 |
| @sentry/nextjs/cloudflare (withSentry) - minified |
222.85 kB |
+0.41% |
+895 B 🔺 |
View base workflow run
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Optional E2E tests
Some optional checks were not successful. They do not block the merge. 6 not successful, 50 successful. See the run.
|
Check |
Status |
|
| ❌ |
CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) |
Failing after 2m |
Details |
| ❌ |
CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) |
Failing after 10m |
Details |
| ❌ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) |
Failing after 28s |
Details |
| ❌ |
CI: Optional E2E Tests / E2E node-eve Test (optional) |
Failing after 2m |
Details |
| ❌ |
CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) |
Failing after 33s |
Details |
| ❌ |
CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) |
Failing after 59s |
Details |
Successful checks
|
Check |
Status |
|
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) |
Successful in 43s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) |
Successful in 48s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) |
Successful in 45s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E deno (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) |
Successful in 52s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) |
Successful in 56s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) |
Successful in 35s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-pi-durable Test (optional) |
Successful in 35s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) |
Successful in 37s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) |
Successful in 28s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) |
Successful in 40s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7 Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) |
Successful in 34s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) |
Successful in 42s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-flue Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) |
Successful in 30s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7-static Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) |
Successful in 40s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) |
Successful in 32s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-mastra Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) |
Successful in 43s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) |
Successful in 50s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) |
Successful in 43s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5 Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) |
Successful in 41s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) |
Successful in 41s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) |
Successful in 38s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) |
Successful in 38s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) |
Successful in 51s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E solidstart-2 Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) |
Successful in 1m |
Details |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+31
to
+34
|
|
if (options.intercept !== false) {
|
|
|
instrumentTunnelServers();
|
|
|
instrumentRuntimeServers?.();
|
|
|
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugbot raised this somewhat weirdly phrased imo, but there's a real issue here.
setupOnce runs once per integration name per process. If the first serveTunnelIntegration set up has intercept: false, then a later client or addIntegration with intercept: true won't install the hooks. Its tunnel requests then go to the app. The reverse case is harmless.
The gate doesn't buy much. Each hook reads intercept per request through getServedTunnelMatch, so with intercept: false installed hooks hand every request to the app anyway. TanStack already installs the hooks without any gate.
Suggestion: drop the if and always install in setupOnce. If the cost of a no-op emit wrapper with intercept: false matters, install from setup(client) when that client's intercept is not false. The install functions already keep their own "done once" flags.
|
if (options.intercept !== false) { |
|
instrumentTunnelServers(); |
|
instrumentRuntimeServers?.(); |
|
} |
|
instrumentTunnelServers(); |
|
instrumentRuntimeServers?.(); |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would only be relevant if multiple clients exist, so that's why I ignored it.
Having multiple clients with two active tunnel configurations is not valid. I would have did it but Bun's hook adds a POST route for the tunnel path, which means we cannot have it both ways.
So this behaviors makes it uniform across runtimes, but leaving this edge case as a gap.
Happy to revisit if you think otherwise.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2918f88. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
`serveTunnelIntegration` answers tunnel requests on every `node:http` server (through the
`http.server.request.start` diagnostics channel), `Bun.serve` and `Deno.serve` before the app sees them.
TanStack Start's `init` installs the hooks itself, since `tunnelRoute` enables the tunnel after `init`.
Every runtime gets the same set of malformed and hostile requests, to prove the app keeps working.
…s emit wrapper
With both wrappers on `emit`, the HTTP one wrapped again on the second request, so every request passed two HTTP
proxies, and anything replacing `emit` later dropped the tunnel. The HTTP wrapper now answers tunnel requests
itself, and the separate tunnel wrapper is only installed without it.
The tunnel wrapped `fetch` and replaced `routes` on the app's own options object, so passing the same object to
`server.reload` wrapped our wrappers again. Options a class gives through a `fetch` getter threw on the assignment
and got no tunnel.
Core's HTTP server instrumentation imported the tunnel's Node handler, so every Node and Cloudflare bundle carried
it. The tunnel now registers the handler in the tunnel store when its hooks install, and the instrumentation calls it
from there.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|