Skip to content

Commit e0ca11e

Browse files
authored
fix(tracing): Make method required in transactionSampling type (#4657)
Though every transaction should have `transactionSampling` metadata, we mark the property as optional because we add it after the transaction is created, in the process of computing a sampling decision for it. Once `transactionSampling` exists, however, it should always have a `method` property.
1 parent dee05a6 commit e0ca11e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/types/src/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export type Measurements = Record<string, { value: number }>;
120120
export type TransactionSamplingMethod = 'explicitly_set' | 'client_sampler' | 'client_rate' | 'inheritance';
121121

122122
export interface TransactionMetadata {
123-
transactionSampling?: { rate?: number; method?: TransactionSamplingMethod };
123+
transactionSampling?: { rate?: number; method: TransactionSamplingMethod };
124124

125125
/** The two halves (sentry and third-party) of a transaction's tracestate header, used for dynamic sampling */
126126
tracestate?: {

0 commit comments

Comments
 (0)