Skip to content

feat(browser)!: Extract performance.{mark,measure} spans into new userTimingSpansIntegration#22554

Open
msonnb wants to merge 2 commits into
developfrom
ms/performance-mark-measure
Open

feat(browser)!: Extract performance.{mark,measure} spans into new userTimingSpansIntegration#22554
msonnb wants to merge 2 commits into
developfrom
ms/performance-mark-measure

Conversation

@msonnb

@msonnb msonnb commented Jul 23, 2026

Copy link
Copy Markdown
Member

What?

browserTracingIntegration no longer captures performance.mark() / performance.measure() spans by default. This behavior moves into a new opt-in userTimingSpansIntegration, and the ignorePerformanceApiSpans option is replaced by the integration's ignore option.

// before
Sentry.init({
  integrations: [
    Sentry.browserTracingIntegration({ ignorePerformanceApiSpans: ['third-party-mark'] }),
  ],
});

// after
Sentry.init({
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.userTimingSpansIntegration({ ignore: ['third-party-mark'] }),
  ],
});

Why?

User Timing spans are useful for some apps and pure noise for others (browser extensions and third-party libraries emit their own mark/measure entries). Bundling them into browserTracingIntegration meant everyone paid the bundle-size and span-volume cost whether they wanted the data or not, and the only escape hatch was an ignore-list. Making it a separate, explicitly-added integration means you opt in when you want it, and it drops out of the tree-shaken bundle when you don't.

Closes #22352

@msonnb

msonnb commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

bugbot run

Comment thread packages/browser-utils/src/metrics/userTimingSpans.ts
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.95 kB - -
@sentry/browser - with treeshaking flags 26.39 kB - -
@sentry/browser (incl. Tracing) 46.14 kB -0.59% -272 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 47.87 kB -0.66% -316 B 🔽
@sentry/browser (incl. Tracing, Profiling) 50.91 kB -0.6% -305 B 🔽
@sentry/browser (incl. Tracing, Replay) 85.38 kB -0.36% -306 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.04 kB -0.39% -290 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 90.1 kB -0.34% -304 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 102.74 kB -0.31% -317 B 🔽
@sentry/browser (incl. Feedback) 45.13 kB - -
@sentry/browser (incl. sendFeedback) 32.74 kB - -
@sentry/browser (incl. FeedbackAsync) 37.8 kB - -
@sentry/browser (incl. Metrics) 29.04 kB - -
@sentry/browser (incl. Logs) 29.26 kB - -
@sentry/browser (incl. Metrics & Logs) 29.97 kB - -
@sentry/react 29.75 kB - -
@sentry/react (incl. Tracing) 48.43 kB -0.58% -282 B 🔽
@sentry/vue 33.38 kB - -
@sentry/vue (incl. Tracing) 48.1 kB -0.61% -294 B 🔽
@sentry/svelte 27.97 kB - -
CDN Bundle 30.28 kB - -
CDN Bundle (incl. Tracing) 48.38 kB +0.27% +126 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.85 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.71 kB +0.28% +134 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 71.13 kB - -
CDN Bundle (incl. Tracing, Replay) 85.97 kB +0.17% +145 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.28 kB +0.16% +139 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.75 kB +0.17% +151 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.06 kB +0.19% +170 B 🔺
CDN Bundle - uncompressed 90.15 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.57 kB +0.25% +357 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.86 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.56 kB +0.24% +357 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.62 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.81 kB +0.14% +357 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.78 kB +0.14% +357 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.51 kB +0.13% +357 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.47 kB +0.13% +357 B 🔺
@sentry/nextjs (client) 50.96 kB -0.55% -280 B 🔽
@sentry/sveltekit (client) 46.56 kB -0.61% -285 B 🔽
@sentry/core/server 80.05 kB - -
@sentry/core/browser 52.01 kB - -
@sentry/node 123.14 kB -0.01% -1 B 🔽
@sentry/node (incl. diagnostics channel injection) 167.14 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 73.31 kB -0.01% -1 B 🔽
@sentry/aws-serverless 82.82 kB - -
@sentry/cloudflare (withSentry) - minified 197.05 kB - -
@sentry/cloudflare (withSentry) 484.73 kB - -

View base workflow run

@msonnb
msonnb marked this pull request as ready for review July 24, 2026 06:45
@msonnb
msonnb requested a review from a team as a code owner July 24, 2026 06:45
@msonnb
msonnb requested review from Lms24 and logaretm and removed request for a team July 24, 2026 06:45

@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 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

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 06b5536. Configure here.

Comment thread packages/browser-utils/src/metrics/userTimingSpans.ts
@msonnb
msonnb marked this pull request as draft July 24, 2026 07:15
@msonnb
msonnb marked this pull request as ready for review July 24, 2026 08:29
@msonnb
msonnb force-pushed the ms/performance-mark-measure branch from 06b5536 to f28a18c Compare July 24, 2026 14:14
Comment thread packages/browser-utils/src/metrics/userTimingSpans.ts
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.

Stop emitting browser mark and measure spans by default

1 participant