Skip to content

Conversation

@andreiborza
Copy link
Member

Closes: #18535

Copy link
Collaborator

@logaretm logaretm left a comment

Choose a reason for hiding this comment

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

Looks nice!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,586 - 11,389 -25%
GET With Sentry 1,613 19% 1,974 -18%
GET With Sentry (error only) 5,900 69% 7,685 -23%
POST Baseline 1,187 - 1,139 +4%
POST With Sentry 562 47% 573 -2%
POST With Sentry (error only) 1,047 88% 1,028 +2%
MYSQL Baseline 3,259 - 4,008 -19%
MYSQL With Sentry 414 13% 537 -23%
MYSQL With Sentry (error only) 2,661 82% 3,218 -17%

View base workflow run

Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

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

Solid implementation, nice readme for the E2E test, well documented lines (e.g. in the config files), well-used span attributes and readable code 💯


const initialWindowLocation = WINDOW.location;
if (instrumentPageLoad && initialWindowLocation) {
const matchedRoutes = router.matchRoutes(
Copy link
Member

Choose a reason for hiding this comment

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

Will this always return an array? Because you do matchedRoutes.length later.

Copy link
Member Author

Choose a reason for hiding this comment

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

They don't really have the docs/types ready yet, but it does so in their react version: https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType#matchroutes-method so I think this is probably going to be fine.

...routeMatchToParamSpanAttributes(lastMatch),
},
});
}
Copy link

Choose a reason for hiding this comment

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

Bug: Pageload span starts at wrong time

startBrowserTracingPageLoadSpan is called without a startTime, so the pageload root span starts “now” (during afterAllSetup) instead of at the navigation time origin. This can skew pageload transaction timing and related performance interpretation compared to the default browser tracing behavior.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair, same thing exists in the other tanstack routers. Will fix this on its own PR.

@andreiborza andreiborza force-pushed the ab/tanstack-router-vue-integration branch from 9a0effe to e577368 Compare December 17, 2025 15:50
navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedLastMatch));
}
}
});
Copy link

Choose a reason for hiding this comment

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

Bug: Navigation listeners may leak on aborted navigations

Each onBeforeNavigate call registers an onResolved subscription that only unsubscribes inside the onResolved callback. If a navigation is cancelled/errors and onResolved never fires, the handler remains subscribed, potentially accumulating listeners over time and causing extra work on later navigations.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

Also exists in the other tanstack router integrations we have, will investigate in a separate issue.

[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.vue.tanstack_router',
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: onBeforeNavigateLastMatch ? 'route' : 'url',
},
});
Copy link

Choose a reason for hiding this comment

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

Bug: Navigation spans omit URL snapshot at start

startBrowserTracingNavigationSpan is called without the url option. This prevents BrowserTracing from snapshotting the navigation URL in scope metadata at span creation time, which can lead to transactions being associated with an incorrect URL if WINDOW.location changes again before the span is sent.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

Also fair, also exists in the other. Will fix in followup.

@andreiborza andreiborza force-pushed the ab/tanstack-router-vue-integration branch from 6ba0963 to e6ebbc8 Compare December 17, 2025 20:51
: // In SSR/non-browser contexts, WINDOW.location may be undefined, so fall back to the router's location
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
navigationLocation?.pathname || onBeforeNavigateArgs.toLocation.pathname,
attributes: {
Copy link

Choose a reason for hiding this comment

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

Bug: Navigation fallback uses previous pathname

When there is no route match during onBeforeNavigate, the navigation span name falls back to WINDOW.location.pathname, which is still the pre-navigation URL. This can mislabel navigation transactions for unmatched/404 routes (or transitional states) as the previous page instead of toLocation.pathname.

Fix in Cursor Fix in Web

@andreiborza andreiborza merged commit 968e529 into develop Dec 17, 2025
207 checks passed
@andreiborza andreiborza deleted the ab/tanstack-router-vue-integration branch December 17, 2025 22:14
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.

Add TanStack Router integration for @sentry/vue

4 participants