diff --git a/packages/tracing/src/transaction.ts b/packages/tracing/src/transaction.ts index 460e202b059c..2b509763743d 100644 --- a/packages/tracing/src/transaction.ts +++ b/packages/tracing/src/transaction.ts @@ -245,11 +245,11 @@ export class Transaction extends SpanClass implements TransactionInterface { const { environment, release } = client.getOptions() || {}; const { publicKey: public_key } = client.getDsn() || {}; - const rate = this.metadata && this.metadata.transactionSampling && this.metadata.transactionSampling.rate; const sample_rate = - rate !== undefined - ? rate.toLocaleString('fullwide', { useGrouping: false, maximumFractionDigits: 16 }) - : undefined; + this.metadata && + this.metadata.transactionSampling && + this.metadata.transactionSampling.rate && + this.metadata.transactionSampling.rate.toString(); const scope = hub.getScope(); const { segment: user_segment } = (scope && scope.getUser()) || {}; diff --git a/packages/tracing/test/span.test.ts b/packages/tracing/test/span.test.ts index 16a1a03749d7..7bb53faca235 100644 --- a/packages/tracing/test/span.test.ts +++ b/packages/tracing/test/span.test.ts @@ -449,30 +449,6 @@ describe('Span', () => { expect(baggage && getThirdPartyBaggage(baggage)).toStrictEqual(''); }); - test('exponential sample rate notation is converted to decimal notation', () => { - const transaction = new Transaction( - { - name: 'tx', - metadata: { - transactionSampling: { rate: 1.45e-14, method: 'client_rate' }, - }, - }, - hub, - ); - - const baggage = transaction.getBaggage(); - - expect(baggage && isSentryBaggageEmpty(baggage)).toBe(false); - expect(baggage && getSentryBaggageItems(baggage)).toStrictEqual({ - release: '1.0.1', - environment: 'production', - // transaction: 'tx', - sample_rate: '0.0000000000000145', - trace_id: expect.any(String), - }); - expect(baggage && getThirdPartyBaggage(baggage)).toStrictEqual(''); - }); - describe('Including transaction name in DSC', () => { test.each([ ['is not included if transaction source is not set', undefined],