Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vue): Implement vue browserTracingIntegration() #10477

Merged
merged 3 commits into from Feb 5, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 2, 2024

This replaces the vueRouterInstrumentation and allows to deprecate browser tracing in the vue package.

Waiting for #10476, then we should put these changes on top of the E2E test to verify it still works.

@mydea mydea requested a review from Lms24 February 2, 2024 14:48
@mydea mydea self-assigned this Feb 2, 2024
@@ -72,76 +70,105 @@ export function vueRouterInstrumentation(
name: WINDOW.location.pathname,
op: 'pageload',
origin: 'auto.pageload.vue',
tags,
data: {
attributes: {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'd say it's ok to stop sending this as a tag and start sending it as an attribute - I don't think anybody will depend on this too much...? Does not seem too relevant for a user.

Copy link
Member

Choose a reason for hiding this comment

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

agreed. I made the same change in the SvelteKit browserTracingIntegration. Realistically, we probably don't need it at all, given that we have sentry.origin but it doesn't hurt us to send it as an attribute.

Copy link
Member

Choose a reason for hiding this comment

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

IMO we can just remove it now that we have sentry.origin across the board, let's save some bundle size.

That was the purpose of having the routing.instrumentation tag in the first place

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove it 🚀

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice, had one comment about something I discovered in the e2e tests but otherwise LGTM!

Comment on lines +134 to +139
let transactionSource: TransactionSource = 'url';
if (to.name && options.routeLabel !== 'path') {
transactionName = to.name.toString();
transactionSource = 'custom';
} else if (to.matched[0] && to.matched[0].path) {
transactionName = to.matched[0].path;
transactionSource = 'route';
}
Copy link
Member

Choose a reason for hiding this comment

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

I think something here is slightly off but it's also off in the original implementation. See #10476 (comment)

Should we just always send route? I mean even if we take the name instead of the path, it still represents a route ultimately. Just a thought. Maybe we do it in a separate PR to fix this atomically in case we need to revert.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, good point 🤔 do we have any place where we rely on some behavior that if source===route we expect it to be a literal route, as in a URL path? 🤔 if not, probably OK to keep this route always I think - cc @AbhiPrasad

Copy link
Member

@Lms24 Lms24 Feb 2, 2024

Choose a reason for hiding this comment

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

afaik the only important distinction in Relay is between source url (where we apply server side clustering/grouping) vs all other sources (like route and custom, where we don't apply this). But not 100% sure anymore.

Copy link
Member

Choose a reason for hiding this comment

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

I asked the ingest team if there's a difference.

Copy link
Member

Choose a reason for hiding this comment

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

I guess internally we also only attach transaction names if they are not URLs to baggage.

I don't know the Relay specifics either, it'll be good to double check them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll merge this as is (as it is the same behavior as before) and as Lukas said, we can change it in a separate PR where we can be clear about the reasoning etc!

@mydea mydea force-pushed the fn/vue-browserTracing branch 2 times, most recently from f0cf86c to 99efe25 Compare February 5, 2024 08:07
@mydea mydea marked this pull request as ready for review February 5, 2024 08:08
Copy link
Contributor

github-actions bot commented Feb 5, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 78.33 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.57 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 73.5 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 63.18 KB (0%)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.52 KB (0%)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 33.39 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.37 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.37 KB (0%)
@sentry/browser - Webpack (gzipped) 22.64 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 76.36 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.89 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.66 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.73 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 214.06 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 101.87 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 74.25 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.8 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.93 KB (0%)
@sentry/react - Webpack (gzipped) 22.67 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 87.55 KB (0%)
@sentry/nextjs Client - Webpack (gzipped) 51.72 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 17.21 KB (0%)

This replaces the `vueRouterInstrumentation` and allows to deprecate browser tracing in the vue package.

fix tests

remove unneeded attribute
// This also only happens during a navigation. A pageload will set the source as 'route'.
// TODO: Figure out what's going on here.
source: 'custom',
source: 'route',
Copy link
Member Author

Choose a reason for hiding this comment

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

@Lms24 I think I fixed the "issue" from this comment here 😅 (I check this both in the "old" format and in the new one, seems to be working in both now, hopefully.

@mydea mydea merged commit 810cb70 into develop Feb 5, 2024
30 checks passed
@mydea mydea deleted the fn/vue-browserTracing branch February 5, 2024 14:27
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.

None yet

3 participants