Skip to content

Commit b82e753

Browse files
logaretmclaude
andcommitted
feat(browser): Emit web vitals as streamed spans when span streaming is enabled
Add non-standalone web vital spans that flow through the v2 span streaming pipeline (afterSpanEnd -> captureSpan -> SpanBuffer). Each web vital gets `browser.web_vital.<metric>.value` attributes and span events for measurement extraction. Spans have meaningful durations showing time from navigation start to the web vital event (except CLS which is a score, not a duration). New tracking functions: trackLcpAsSpan, trackClsAsSpan, trackInpAsSpan, trackTtfbAsSpan, trackFcpAsSpan, trackFpAsSpan — wired up in browserTracingIntegration.setup() when hasSpanStreamingEnabled(client). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5bd81ce commit b82e753

File tree

4 files changed

+928
-0
lines changed

4 files changed

+928
-0
lines changed

packages/browser-utils/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
addTtfbInstrumentationHandler,
55
addLcpInstrumentationHandler,
66
addInpInstrumentationHandler,
7+
addFcpInstrumentationHandler,
78
} from './metrics/instrument';
89

910
export {
@@ -20,6 +21,15 @@ export { startTrackingElementTiming } from './metrics/elementTiming';
2021

2122
export { extractNetworkProtocol } from './metrics/utils';
2223

24+
export {
25+
trackClsAsSpan,
26+
trackFcpAsSpan,
27+
trackFpAsSpan,
28+
trackInpAsSpan,
29+
trackLcpAsSpan,
30+
trackTtfbAsSpan,
31+
} from './metrics/webVitalSpans';
32+
2333
export { addClickKeypressInstrumentationHandler } from './instrument/dom';
2434

2535
export { addHistoryInstrumentationHandler } from './instrument/history';

0 commit comments

Comments
 (0)