Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/tracing/src/hubextensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ function sample<T extends Transaction>(
// if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
if (transaction.sampled !== undefined) {
transaction.setMetadata({
transactionSampling: { method: 'explicitly_set' },
transactionSampling: {
method: 'explicitly_set',
rate: Number(transaction.sampled),
},
});
return transaction;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/test/hub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('Hub', () => {
hub.startTransaction({ name: 'dogpark', sampled: true });

expect(Transaction.prototype.setMetadata).toHaveBeenCalledWith({
transactionSampling: { method: 'explicitly_set' },
transactionSampling: { method: 'explicitly_set', rate: 1.0 },
});
});

Expand Down