Skip to content

Commit 6b498af

Browse files
logaretmclaude
andcommitted
fix(browser): Prevent duplicate INP spans when span streaming is enabled
Gate standalone INP (`startTrackingINP`) behind `!spanStreamingEnabled` and gate streamed INP (`trackInpAsSpan`) behind `enableInp` so both paths respect the user's preference and don't produce duplicate data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1b6dcf6 commit 6b498af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/browser/src/tracing/browserTracingIntegration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,12 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
501501
if (spanStreamingEnabled) {
502502
trackLcpAsSpan(client);
503503
trackClsAsSpan(client);
504-
trackInpAsSpan(client);
504+
if (enableInp) {
505+
trackInpAsSpan(client);
506+
}
505507
}
506508

507-
if (enableInp) {
509+
if (enableInp && !spanStreamingEnabled) {
508510
startTrackingINP();
509511
}
510512

0 commit comments

Comments
 (0)