Skip to content

feat(vue): Register Vue route provider - #23793

Open
logaretm wants to merge 5 commits into
awad/route-provider-astrofrom
awad/route-provider-vue-app
Open

logaretm wants to merge 5 commits into
awad/route-provider-astrofrom
awad/route-provider-vue-app

Conversation

@logaretm

Copy link
Copy Markdown
Member

Registers a route provider for Vue, read off the Vue app the SDK is already given.

vue-router sets app.config.globalProperties.$router when it installs, so the provider needs no new option and no router passed to the tracing integration. That means it works for users who never pass router to browserTracingIntegration, and route parameterization no longer depends on tracing being enabled.

The router is looked up per call rather than captured at registration, because app.use(router) may legitimately run either side of Sentry.init().

Returns the matched path rather than route.name, even under routeLabel: 'name'. Callers set url.template from this and a route name is an identifier, not a template. The navigation instrumentation still names the span after the route name when the user asked for it.

Part of #23556

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.16 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 51.18 kB +0.02% +8 B 🔺
@sentry/browser (incl. Tracing, Profiling) 54.19 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay) 90.77 kB +0.01% +8 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.87 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 95.47 kB +0.01% +7 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 108.42 kB +0.01% +8 B 🔺
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.46 kB +0.03% +11 B 🔺
@sentry/vue 37 kB +0.72% +261 B 🔺
@sentry/vue (incl. Tracing) 53.86 kB +0.3% +159 B 🔺
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.7 kB +0.03% +12 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.67 kB +0.03% +11 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.29 kB +0.02% +9 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB +0.01% +9 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 95.46 kB +0.02% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.43 kB +0.02% +12 B 🔺
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.81 kB +0.03% +41 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.77 kB +0.03% +41 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.54 kB +0.02% +41 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.48 kB +0.02% +41 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.25 kB +0.02% +41 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.17 kB +0.02% +41 B 🔺
@sentry/nextjs (client) 56.03 kB +0.46% +254 B 🔺
@sentry/sveltekit (client) 51.6 kB +0.02% +9 B 🔺
@sentry/core/server 39.96 kB +0.03% +11 B 🔺
@sentry/core/browser 13.63 kB - -
@sentry/node 133.91 kB +0.02% +17 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.43 kB - -
@sentry/node - without tracing 90.47 kB +0.03% +27 B 🔺
@sentry/node - without channel injection 112.42 kB +0.02% +21 B 🔺
@sentry/aws-serverless 98.72 kB +0.02% +13 B 🔺
@sentry/cloudflare (withSentry) - minified 206.53 kB +0.03% +49 B 🔺
@sentry/cloudflare (withSentry) 513.8 kB +0.02% +70 B 🔺

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you apply the label PR: no-auto-close I will leave it alone ... forever!

@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch from a1394dd to ece4da5 Compare September 24, 2026 18:04
@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch from ece4da5 to a309ce7 Compare September 24, 2026 18:14
@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch from a309ce7 to 3dbcc53 Compare September 24, 2026 18:30
@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch from 3dbcc53 to 227053e Compare September 24, 2026 18:50
@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch 2 times, most recently from 22d7992 to e741e61 Compare September 24, 2026 19:59
@logaretm logaretm changed the title feat(vue): Register a route provider read off the Vue app feat(vue): Register Vue route provider Sep 24, 2026
@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.

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.

Reviewed by Cursor Bugbot for commit e741e61. Configure here.

Comment thread packages/vue/src/routeProvider.ts
Comment thread packages/vue/test/routeProvider.test.ts
`vue-router` sets `app.config.globalProperties.$router` when it installs, and the
SDK is already given the app, so the provider needs no new option and no router
passed to the tracing integration.

Registered from `init()`, so route parameterization no longer depends on tracing
being enabled and works for users who never pass `router` to
`browserTracingIntegration`. The router is looked up per call rather than
captured, because `app.use(router)` may run either side of `Sentry.init()`.

Returns the matched path rather than `route.name` even under
`routeLabel: 'name'`: callers set `url.template` from this and a route name is an
identifier, not a template. The navigation instrumentation still names the span
after the route name when the user asked for it.
@logaretm
logaretm force-pushed the awad/route-provider-vue-app branch from e741e61 to b344925 Compare September 24, 2026 21:20
@logaretm
logaretm marked this pull request as ready for review September 24, 2026 21:26
@logaretm
logaretm requested a review from a team as a code owner September 24, 2026 21:26
@logaretm
logaretm requested review from chargome and removed request for a team September 24, 2026 21:26

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant