Skip to content

Commit a65df3d

Browse files
committed
fix(opentelemetry): Ensure unsent spans are ignored in span exporter
1 parent b615f61 commit a65df3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/opentelemetry/src/spanExporter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ export class SentrySpanExporter {
180180

181181
this.flushSentSpanCache();
182182
const sentSpans = this._maybeSend(finishedSpans);
183-
for (const span of finishedSpans) {
184-
this._sentSpans.set(span.spanContext().spanId, Date.now() + DEFAULT_TIMEOUT * 1000);
185-
}
186183

187184
const sentSpanCount = sentSpans.size;
188185
const remainingOpenSpanCount = finishedSpans.length - sentSpanCount;
@@ -192,6 +189,7 @@ export class SentrySpanExporter {
192189
);
193190

194191
for (const span of sentSpans) {
192+
this._sentSpans.set(span.spanContext().spanId, Date.now() + DEFAULT_TIMEOUT * 1000);
195193
const bucketEntry = this._spansToBucketEntry.get(span);
196194
if (bucketEntry) {
197195
bucketEntry.spans.delete(span);

0 commit comments

Comments
 (0)