Skip to content

feat: Accept tunnel: true in init to enable the managed tunnel - #25200

Draft
logaretm wants to merge 4 commits into
awad/tunnel-core-dsn-pathfrom
awad/tunnel-browser-managed
Draft

logaretm wants to merge 4 commits into
awad/tunnel-core-dsn-pathfrom
awad/tunnel-browser-managed

Conversation

@logaretm

@logaretm logaretm commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

There was no way to turn on a managed tunnel from init, fixed by accepting tunnel: true so the browser sends to the DSN-derived path and server SDKs flag that they serve it.

The tests check the browser path matches what the server accepts, the new envelope content type, and that server SDKs keep sending their own events directly.

@logaretm
logaretm added this pull request to stack #25201 October 8, 2026 15:45
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from ec2da8d to 2933944 Compare October 8, 2026 16:05
@logaretm logaretm changed the title feat(browser): Add applyManagedTunnel to point the tunnel at the DSN-derived path feat: Accept tunnel: true in init to enable the managed tunnel Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.67 kB +2.66% +794 B 🔺
@sentry/browser - with treeshaking flags 28.54 kB +1.86% +520 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.43 kB +1.81% +504 B 🔺
@sentry/browser (incl. Tracing) 52.86 kB +1.52% +791 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.87 kB +1.54% +799 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.78 kB +1.39% +763 B 🔺
@sentry/browser (incl. Tracing, Replay) 92.59 kB +0.84% +771 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.18 kB +0.62% +496 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 97.31 kB +0.8% +766 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 110.28 kB +0.73% +797 B 🔺
@sentry/browser (incl. Feedback) 48.19 kB +1.69% +799 B 🔺
@sentry/browser (incl. sendFeedback) 35.75 kB +2.33% +812 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.85 kB +2% +800 B 🔺
@sentry/browser (incl. Metrics) 31.66 kB +2.46% +759 B 🔺
@sentry/browser (incl. Logs) 31.94 kB +2.44% +758 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.64 kB +2.62% +831 B 🔺
@sentry/react 32.47 kB +2.44% +772 B 🔺
@sentry/react (incl. Tracing) 55.15 kB +1.41% +766 B 🔺
@sentry/vue 38.82 kB +2.06% +783 B 🔺
@sentry/vue (incl. Tracing) 55.8 kB +1.44% +790 B 🔺
@sentry/svelte 30.7 kB +2.69% +802 B 🔺
@sentry/remix (Remix 3 client bundle) 57.9 kB +1.44% +819 B 🔺
CDN Bundle 32.09 kB +1.41% +445 B 🔺
CDN Bundle (incl. Tracing) 53.05 kB +0.89% +465 B 🔺
CDN Bundle (incl. Logs, Metrics) 34.29 kB +1.34% +452 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.99 kB +0.86% +466 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 75.23 kB +0.62% +462 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.72 kB +0.53% +475 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.7 kB +0.57% +523 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.84 kB +0.46% +438 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.88 kB +0.55% +536 B 🔺
CDN Bundle - uncompressed 94.33 kB +1.23% +1.15 kB 🔺
CDN Bundle (incl. Tracing) - uncompressed 157.17 kB +0.73% +1.13 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.87 kB +1.15% +1.15 kB 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.13 kB +0.71% +1.13 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.91 kB +0.5% +1.15 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.33 kB +0.42% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 283.28 kB +0.41% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.04 kB +0.4% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.97 kB +0.39% +1.13 kB 🔺
@sentry/nextjs (client) 57.56 kB +1.35% +764 B 🔺
@sentry/sveltekit (client) 53.22 kB +1.47% +771 B 🔺
@sentry/core/server 41.75 kB +1.53% +629 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 153.12 kB +0.43% +652 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.81 kB - -
@sentry/node - without tracing 95.26 kB +0.7% +653 B 🔺
@sentry/node - without channel injection 131.31 kB +0.48% +619 B 🔺
@sentry/aws-serverless 103.53 kB +0.75% +762 B 🔺
@sentry/cloudflare (withSentry) - minified 212.26 kB +0.8% +1.67 kB 🔺
@sentry/cloudflare (withSentry) 525.91 kB +0.65% +3.38 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 229.94 kB +0.73% +1.67 kB 🔺

View base workflow run

@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from 2933944 to 4837dc0 Compare October 15, 2026 14:38
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch 2 times, most recently from d5c110f to 4ab6297 Compare October 15, 2026 14:44
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from 4ab6297 to bf1d62c Compare October 15, 2026 14:47
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch 3 times, most recently from 75a299e to b1553a8 Compare October 15, 2026 15:36
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from b1553a8 to 0e573ca Compare October 15, 2026 15:51
@logaretm logaretm changed the title feat: Accept tunnel: true in init to enable the managed tunnel feat: Accept tunnel: true in the SDKs that serve the managed tunnel Oct 15, 2026
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from 1d77f74 to 80f1700 Compare October 15, 2026 17:15
@logaretm logaretm changed the title feat: Accept tunnel: true in the SDKs that serve the managed tunnel feat: Accept tunnel: true in init to enable the managed tunnel Oct 15, 2026
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch 4 times, most recently from a769b10 to d79df66 Compare October 15, 2026 18:28
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@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/core/src/client.ts Outdated
Comment thread packages/browser/src/utils/managedTunnel.ts
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from d79df66 to 8717465 Compare October 16, 2026 01:51
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

1 similar comment
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@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/aws-serverless/src/init.ts
Comment thread packages/browser/test/utils/managedTunnel.test.ts
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

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

✅ Bugbot reviewed your changes and found no new issues!

2 issues from previous reviews remain unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 3fcc2f7. Configure here.

Setting `tunnel: true` (or `{ allowedDsns, basePath, trailingSlash }`) in both
the browser and the server `init` enables the managed tunnel. The browser
resolves it to the DSN-derived same-origin path and sends envelopes as
`application/x-sentry-envelope`, because SvelteKit and Astro CSRF checks reject
a same-origin `text/plain` POST. Server SDKs keep their own envelopes going
directly to Sentry and set `_managedTunnel` for their request handlers.
With `debug: true`, the client warns once when a managed tunnel request gets a
403, 404 or 405, pointing at the server side: a meta-framework SDK, an endpoint
calling `handleTunnelRequest`, or `allowedDsns`.
@logaretm
logaretm force-pushed the awad/tunnel-browser-managed branch from 3fcc2f7 to f103bee Compare October 16, 2026 04:23

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.

1 participant