Skip to content

Commit 7df4cd4

Browse files
logaretmclaude
andcommitted
fix(browser): Skip CLS/LCP measurements on pageload span when streaming
When span streaming is enabled, CLS and LCP are emitted as streamed spans. Previously they were also recorded as measurements on the pageload span because the flags only checked enableStandaloneClsSpans and enableStandaloneLcpSpans, which default to undefined. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50591cf commit 7df4cd4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/browser/src/tracing/browserTracingIntegration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,10 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
452452
// This will generally always be defined here, because it is set in `setup()` of the integration
453453
// but technically, it is optional, so we guard here to be extra safe
454454
_collectWebVitals?.();
455+
const spanStreamingEnabled = hasSpanStreamingEnabled(client);
455456
addPerformanceEntries(span, {
456-
recordClsOnPageloadSpan: !enableStandaloneClsSpans,
457-
recordLcpOnPageloadSpan: !enableStandaloneLcpSpans,
457+
recordClsOnPageloadSpan: !spanStreamingEnabled && !enableStandaloneClsSpans,
458+
recordLcpOnPageloadSpan: !spanStreamingEnabled && !enableStandaloneLcpSpans,
458459
ignoreResourceSpans,
459460
ignorePerformanceApiSpans,
460461
});

0 commit comments

Comments
 (0)