Skip to content

Commit 7257c87

Browse files
committed
add missing tracestate when capturing transaction, if necessary
1 parent 99cf269 commit 7257c87

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/tracing/src/transaction.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ export class Transaction extends SpanClass implements TransactionInterface {
116116
}).endTimestamp;
117117
}
118118

119+
// ensure that we have a tracestate to attach to the envelope header
120+
if (!this.metadata.tracestate?.sentry) {
121+
this.metadata.tracestate = { ...this.metadata.tracestate, sentry: this._getNewTracestate() };
122+
}
123+
119124
const transaction: Event = {
120125
contexts: {
121126
trace: this.getTraceContext(),

0 commit comments

Comments
 (0)