Skip to content

Commit 04fbd09

Browse files
committed
fix: don't double-send standalone spans
1 parent dd0180a commit 04fbd09

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/core/src/tracing/sentrySpan.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,14 @@ export class SentrySpan implements Span {
316316
const client = getClient();
317317
if (client) {
318318
client.emit('spanEnd', this);
319-
client.emit('afterSpanEnd', this);
319+
// Guarding sending standalone v1 spans as v2 streamed spans for now.
320+
// Otherwise they'd be sent once as v1 spans and again as streamed spans.
321+
// We'll migrate CLS and LCP spans to streamed spans in a later PR and
322+
// INP spans in the next major of the SDK. At that point, we can fully remove
323+
// standalone v1 spans <3
324+
if (!this._isStandaloneSpan) {
325+
client.emit('afterSpanEnd', this);
326+
}
320327
}
321328

322329
// A segment span is basically the root span of a local span tree.

0 commit comments

Comments
 (0)