Skip to content

Commit 50e0d19

Browse files
committed
add note about getBaggage() baggage modification
1 parent 4559a85 commit 50e0d19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/tracing/src/span.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ export class Span implements SpanInterface {
315315
public getBaggage(): Baggage | undefined {
316316
const existingBaggage = this.transaction && this.transaction.metadata.baggage;
317317

318+
// Only add Sentry baggage items to baggage, if baggage does not exist yet or it is still
319+
// empty and not yet set immutable
318320
const finalBaggage =
319321
!existingBaggage || (!isBaggageFrozen(existingBaggage) && isSentryBaggageEmpty(existingBaggage))
320322
? this._getBaggageWithSentryValues(existingBaggage)

0 commit comments

Comments
 (0)