Skip to content

feat(browser): Add detail to measure spans and add regression tests #16557

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

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jun 11, 2025

resolves #16237

In #16348 we had to revert the PR that added detail to measure spans as attributes.

measure API: https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure
detail: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure/detail

This was reverted because it was causing issues in firefox, specifically this error was being thrown

Error: Permission denied to access object
  at _addMeasureSpans(../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js:255:41)
  at X2e/<(../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js:194:9)
  at addPerformanceEntries(../../node_modules/@sentry-internal/browser-utils/build/esm/metrics/browserMetrics.js:174:48)
  at idleSpan.beforeSpanEnd(../../node_modules/@sentry/browser/build/npm/esm/tracing/browserTracingIntegration.js:90:9)
  at span.endapply(../../node_modules/@sentry/browser/node_modules/@sentry/core/build/esm/tracing/idleSpan.js:52:9)
  at Coe/<(../../node_modules/@sentry/browser/node_modules/@sentry/core/build/esm/tracing/idleSpan.js:196:12)
  at sentryWrapped(../../node_modules/@sentry/browser/build/npm/esm/helpers.js:38:17)

From debugging, this seems to be coming from a DOMException being thrown @https://developer.mozilla.org/en-US/docs/Web/API/DOMException

This was re-implemented, and then we added tests to validate that this wouldn't break on firefox.

Copy link
Contributor

⚠️ This PR is opened against master. You probably want to open it against develop.

@AbhiPrasad AbhiPrasad changed the base branch from master to develop June 11, 2025 19:01
Copy link
Contributor

github-actions bot commented Jun 11, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB - -
@sentry/browser - with treeshaking flags 23.76 kB - -
@sentry/browser (incl. Tracing) 38.79 kB +0.28% +107 B 🔺
@sentry/browser (incl. Tracing, Replay) 76.89 kB +0.15% +110 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.97 kB +0.16% +105 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 81.65 kB +0.14% +110 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 93.72 kB +0.13% +119 B 🔺
@sentry/browser (incl. Feedback) 40.73 kB - -
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.59 kB - -
@sentry/react 25.76 kB - -
@sentry/react (incl. Tracing) 40.78 kB +0.28% +111 B 🔺
@sentry/vue 28.36 kB - -
@sentry/vue (incl. Tracing) 40.66 kB +0.26% +102 B 🔺
@sentry/svelte 24.01 kB - -
CDN Bundle 25.48 kB - -
CDN Bundle (incl. Tracing) 38.96 kB +0.49% +189 B 🔺
CDN Bundle (incl. Tracing, Replay) 74.78 kB +0.2% +145 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 80.2 kB +0.13% +103 B 🔺
CDN Bundle - uncompressed 74.48 kB - -
CDN Bundle (incl. Tracing) - uncompressed 115.3 kB +0.36% +408 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 229.27 kB +0.18% +408 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 242.09 kB +0.17% +408 B 🔺
@sentry/nextjs (client) 42.44 kB +0.26% +109 B 🔺
@sentry/sveltekit (client) 39.28 kB +0.29% +111 B 🔺
@sentry/node 150.56 kB -0.01% -1 B 🔽
@sentry/node - without tracing 98.4 kB - -
@sentry/aws-serverless 124.15 kB -0.01% -1 B 🔽

View base workflow run

@AbhiPrasad AbhiPrasad self-assigned this Jun 11, 2025
@AbhiPrasad AbhiPrasad marked this pull request as ready for review June 11, 2025 19:08
@AbhiPrasad AbhiPrasad requested review from a team, mydea and RulaKhaled and removed request for a team June 11, 2025 19:08
@AbhiPrasad AbhiPrasad changed the title Re-implement measure detail feature with tests feat(browser): Add detail to measure spans and add regression tests Jun 11, 2025
@AbhiPrasad AbhiPrasad force-pushed the cursor/re-implement-measure-detail-feature-with-tests-3841 branch from 0550701 to b437a13 Compare June 11, 2025 19:10
@Lms24
Copy link
Member

Lms24 commented Jun 12, 2025

Thanks for revisiting!

@AbhiPrasad AbhiPrasad merged commit 4e7c7ef into develop Jun 13, 2025
164 checks passed
@AbhiPrasad AbhiPrasad deleted the cursor/re-implement-measure-detail-feature-with-tests-3841 branch June 13, 2025 15: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.

Enrich attributes of Spans created from PerformanceMeasure events
3 participants