Skip to content

DSC: sample_rate is not set when sample decision is forced #5690

Closed
@Lms24

Description

@Lms24

Problem Statement

When starting a transaction, users can force a sample decision by settingtransaction.sampled to true or false. We don't set the sample rate in the transaction metadata in this case:

// 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' },
});
return transaction;
}
// we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` were defined, so one of these should
// work; prefer the hook if so

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions