From e0ca11e0cea9f268ea0664c3ac87909ddd1599d8 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Tue, 1 Mar 2022 09:48:52 -0800 Subject: [PATCH] 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. --- packages/types/src/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/transaction.ts b/packages/types/src/transaction.ts index 585eb66dd8dd..d2a8744cd335 100644 --- a/packages/types/src/transaction.ts +++ b/packages/types/src/transaction.ts @@ -120,7 +120,7 @@ export type Measurements = Record; 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?: {