From 62ab5ecb952b6cdce3dde957ad6ec24ad539e799 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 12 Jul 2024 12:56:26 +0000 Subject: [PATCH 1/4] ref: Deprecate `enableTracing` --- packages/types/src/options.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/types/src/options.ts b/packages/types/src/options.ts index 8b2dbebdd574..82431461d3ba 100644 --- a/packages/types/src/options.ts +++ b/packages/types/src/options.ts @@ -89,9 +89,13 @@ export interface ClientOptions Date: Fri, 12 Jul 2024 13:01:45 +0000 Subject: [PATCH 2/4] changelog entry --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d01cdce384..3cb4e06bbddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +### Important Changes + +- **ref: Deprecate `enableTracing` (12897)** + +The `enableTracing` option has been deprecated and will be removed in the next major version. We recommend removing it +in favor of the `tracesSampleRate` and `tracesSampler` options. If you want to enable performance monitoring, please set +the `tracesSampleRate` to a sample rate of your choice, or provide a sampling function as `tracesSampler` option +instead. If you wan't to disable performance monitoring, remove the `tracesSampler` option and set the +`tracesSampleRate` to `0` or `undefined`. + Work in this release was contributed by @GitSquared. Thank you for your contribution! ## 8.17.0 From 7fbd56baa458f0db052ca316c8248b9aefb1c864 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 12 Jul 2024 13:16:38 +0000 Subject: [PATCH 3/4] Review feedback --- CHANGELOG.md | 3 +-- packages/core/src/utils/hasTracingEnabled.ts | 1 + packages/types/src/options.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb4e06bbddb..6fd671757241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,7 @@ The `enableTracing` option has been deprecated and will be removed in the next major version. We recommend removing it in favor of the `tracesSampleRate` and `tracesSampler` options. If you want to enable performance monitoring, please set the `tracesSampleRate` to a sample rate of your choice, or provide a sampling function as `tracesSampler` option -instead. If you wan't to disable performance monitoring, remove the `tracesSampler` option and set the -`tracesSampleRate` to `0` or `undefined`. +instead. If you wan't to disable performance monitoring, remove the `tracesSampler` and `tracesSampleRate` options. Work in this release was contributed by @GitSquared. Thank you for your contribution! diff --git a/packages/core/src/utils/hasTracingEnabled.ts b/packages/core/src/utils/hasTracingEnabled.ts index 97463d9d5e5e..5e673bc08caa 100644 --- a/packages/core/src/utils/hasTracingEnabled.ts +++ b/packages/core/src/utils/hasTracingEnabled.ts @@ -17,6 +17,7 @@ export function hasTracingEnabled( } const options = maybeOptions || getClientOptions(); + // eslint-disable-next-line deprecation/deprecation return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); } diff --git a/packages/types/src/options.ts b/packages/types/src/options.ts index 82431461d3ba..d6c407d60bd0 100644 --- a/packages/types/src/options.ts +++ b/packages/types/src/options.ts @@ -93,9 +93,9 @@ export interface ClientOptions Date: Mon, 15 Jul 2024 08:02:16 +0000 Subject: [PATCH 4/4] lint --- packages/node/src/sdk/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/node/src/sdk/index.ts b/packages/node/src/sdk/index.ts index 2ac62a2b5b91..0fb7774827f9 100644 --- a/packages/node/src/sdk/index.ts +++ b/packages/node/src/sdk/index.ts @@ -92,6 +92,7 @@ function shouldAddPerformanceIntegrations(options: Options): boolean { } // We want to ensure `tracesSampleRate` is not just undefined/null here + // eslint-disable-next-line deprecation/deprecation return options.enableTracing || options.tracesSampleRate != null || 'tracesSampler' in options; }