Skip to content

feat(browser): Core Web Vitals as browser.web_vital log events - #1150

Merged
Makisuo merged 4 commits into
feat/browser-sdk-xhr-pageloadfrom
feat/browser-sdk-web-vitals
Sep 29, 2026
Merged

Makisuo merged 4 commits into
feat/browser-sdk-xhr-pageloadfrom
feat/browser-sdk-web-vitals

Merge branch 'feat/browser-sdk-xhr-pageload' into feat/browser-sdk-we…

ab3f6b9
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Sep 29, 2026 in 8m 55s

Confidence 5/5 · No issues found

Confidence 5/5 · safe to merge
The web-vitals code itself is contained and tested; the two files the kickoff named are not part of this PR's diff against its base and could not be reviewed here.
quality 100/100 · no findings · tests covered · risk low · 1/1 new units observable

Adds Core Web Vitals to the browser SDK as browser.web_vital log events emitted from the deferred chunk, each linked to the document's pageload span and gated by a new webVitals flag. Contained and tested; safe to merge.

  • startWebVitals reports LCP/CLS/INP/FCP/TTFB as browser.web_vital log events
  • The deferred chunk links each vital to the document pageload span
  • New webVitals config flag, default true, gates reporting
What was checked
  • Earlier F1 is fixed: report no longer gates emission on a pageload span (web-vitals.ts:14-31), and the untraced browser test asserts an event with no spanContext.
  • webVitals: false is threaded through resolveConfig (config.ts:222) and set in both browser test configs, so vitals cannot leak between tests in one file.
  • startWebVitals keeps the once-per-page library registration and only gates reporting, so a later init() resumes reporting (web-vitals.ts:38-45).
Observability coverage: 1 of 1 changes observable
Change Kind Observable Evidence
Web vital reporting (LCP, CLS, INP, FCP, TTFB) → browser.web_vital log event log-based event yes web-vitals.ts:16-31 emits a structured event with semconv attributes, session.id, url.path and the pageload span link

ab3f6b9 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple to ask about one.