Skip to content

Commit 616915b

Browse files
author
Luca Forstner
authored
ref: Deprecate enableTracing (#12897)
1 parent eaf6055 commit 616915b

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88

99
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
1010

11+
### Important Changes
12+
13+
- **ref: Deprecate `enableTracing` (12897)**
14+
15+
The `enableTracing` option has been deprecated and will be removed in the next major version. We recommend removing it
16+
in favor of the `tracesSampleRate` and `tracesSampler` options. If you want to enable performance monitoring, please set
17+
the `tracesSampleRate` to a sample rate of your choice, or provide a sampling function as `tracesSampler` option
18+
instead. If you wan't to disable performance monitoring, remove the `tracesSampler` and `tracesSampleRate` options.
19+
1120
Work in this release was contributed by @GitSquared. Thank you for your contribution!
1221

1322
## 8.17.0

packages/core/src/utils/hasTracingEnabled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function hasTracingEnabled(
1717
}
1818

1919
const options = maybeOptions || getClientOptions();
20+
// eslint-disable-next-line deprecation/deprecation
2021
return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);
2122
}
2223

packages/node/src/sdk/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function shouldAddPerformanceIntegrations(options: Options): boolean {
9292
}
9393

9494
// We want to ensure `tracesSampleRate` is not just undefined/null here
95+
// eslint-disable-next-line deprecation/deprecation
9596
return options.enableTracing || options.tracesSampleRate != null || 'tracesSampler' in options;
9697
}
9798

packages/types/src/options.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
8989
tracesSampleRate?: number;
9090

9191
/**
92-
* If this is enabled, transactions and trace data will be generated and captured.
92+
* If this is enabled, spans and trace data will be generated and captured.
9393
* This will set the `tracesSampleRate` to the recommended default of `1.0` if `tracesSampleRate` is undefined.
9494
* Note that `tracesSampleRate` and `tracesSampler` take precedence over this option.
95+
*
96+
* @deprecated This option is deprecated and will be removed in the next major version. If you want to enable performance
97+
* monitoring, please use the `tracesSampleRate` or `tracesSampler` options instead. If you wan't to disable performance
98+
* monitoring, remove the `tracesSampler` and `tracesSampleRate` options.
9599
*/
96100
enableTracing?: boolean;
97101

0 commit comments

Comments
 (0)