Skip to content

Commit

Permalink
fix(tracing): Make method required in transactionSampling type (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
lobsterkatie authored Mar 1, 2022
1 parent dee05a6 commit e0ca11e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/types/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export type Measurements = Record<string, { value: number }>;
export type TransactionSamplingMethod = 'explicitly_set' | 'client_sampler' | 'client_rate' | 'inheritance';

export interface TransactionMetadata {
transactionSampling?: { rate?: number; method?: TransactionSamplingMethod };
transactionSampling?: { rate?: number; method: TransactionSamplingMethod };

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

0 comments on commit e0ca11e

Please sign in to comment.