Skip to content

Commit 04dffa3

Browse files
committed
fix(tracing): Set sample rate in transaction
metadata and DSC
1 parent 70883aa commit 04dffa3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/tracing/src/hubextensions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ function sample<T extends Transaction>(
5555
// if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
5656
if (transaction.sampled !== undefined) {
5757
transaction.setMetadata({
58-
transactionSampling: { method: 'explicitly_set' },
58+
transactionSampling: {
59+
method: 'explicitly_set',
60+
rate: Number(transaction.sampled),
61+
},
5962
});
6063
return transaction;
6164
}

0 commit comments

Comments
 (0)