Skip to content

ref(browser): Update scope.transactionName on pageload and navigation span creation #10992

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

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Mar 8, 2024

Builds on top of #10991

This PR updates the transaction name on the scope in the default browserTracingIntegration and whenever startBrowserTracingNavigationSpan and startBrowserTracingPageLoadSpan are called from higher-level SDKs' integrations.

In a follow-up PR, I'm going to make the same update in our individual browserTracingIntegrations whenever we have access to a parameterized transaction name.

ref #10846

@Lms24 Lms24 changed the base branch from develop to lms/feat-core-scopedata-transactionName March 8, 2024 15:57
Copy link
Contributor

github-actions bot commented Mar 8, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 76.99 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.25 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.13 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 61.8 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.45 KB (+0.06% 🔺)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 32.45 KB (+0.06% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.37 KB (+0.02% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.37 KB (+0.02% 🔺)
@sentry/browser - Webpack (gzipped) 22.56 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - CDN Bundle (gzipped) 75.1 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - CDN Bundle (gzipped) 66.71 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - CDN Bundle (gzipped) 32.56 KB (+0.1% 🔺)
@sentry/browser - CDN Bundle (gzipped) 24.02 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay) - CDN Bundle (minified & uncompressed) 209.13 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing) - CDN Bundle (minified & uncompressed) 97.93 KB (+0.12% 🔺)
@sentry/browser - CDN Bundle (minified & uncompressed) 71.77 KB (+0.07% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.45 KB (+0.03% 🔺)
@sentry/react - Webpack (gzipped) 22.59 KB (+0.04% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 84.96 KB (+0.03% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.36 KB (+0.04% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.42 KB (+0.07% 🔺)

@Lms24 Lms24 self-assigned this Mar 8, 2024
@Lms24 Lms24 force-pushed the lms/feat-core-scopedata-transactionName branch from 45b7d13 to 81e048b Compare March 11, 2024 13:29
@Lms24 Lms24 force-pushed the lms/feat-browser-scope-setTransactionName branch from 1852724 to f8b2005 Compare March 11, 2024 15:51
Base automatically changed from lms/feat-core-scopedata-transactionName to develop March 12, 2024 10:41
@Lms24 Lms24 force-pushed the lms/feat-browser-scope-setTransactionName branch from 2932733 to 6ef628d Compare March 12, 2024 10:44
@Lms24 Lms24 requested a review from mydea March 12, 2024 10:45
@Lms24 Lms24 requested a review from AbhiPrasad March 12, 2024 10:57
@@ -364,6 +364,8 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
export function startBrowserTracingPageLoadSpan(client: Client, spanOptions: StartSpanOptions): Span | undefined {
client.emit('startPageLoadSpan', spanOptions);

getCurrentScope().setTransactionName(spanOptions.name);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder now, if that should possibly go on the isolation scope 🤔 (generally for all our auto-instrumentation). Has up-and downsides... probably it's fine this way, just thinking out loud!

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, I think in the browser it doesn't matter that much, given we're not automatically forking scopes (afaik) 🤔

I think on the server, the isolation scope makes a lot of sense since it generally lasts as long as a request, no?

@Lms24 Lms24 merged commit 11b1a75 into develop Mar 12, 2024
@Lms24 Lms24 deleted the lms/feat-browser-scope-setTransactionName branch March 12, 2024 14:52
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.

2 participants