Skip to content

Commit 6fc9e18

Browse files
committed
Replace 'tracemetric' in public facing api with 'metric' (eg. enableMetrics) since trace metric is an internal dataset detail
1 parent 0d7323c commit 6fc9e18

File tree

10 files changed

+61
-61
lines changed

10 files changed

+61
-61
lines changed

dev-packages/browser-integration-tests/suites/public-api/metrics/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
_experiments: {
8-
enableTraceMetrics: true,
8+
enableMetrics: true,
99
},
1010
release: '1.0.0',
1111
environment: 'test',

dev-packages/node-core-integration-tests/suites/public-api/metrics/scenario.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const client = Sentry.init({
77
release: '1.0.0',
88
environment: 'test',
99
_experiments: {
10-
enableTraceMetrics: true,
10+
enableMetrics: true,
1111
},
1212
transport: loggingTransport,
1313
});

dev-packages/node-integration-tests/suites/public-api/metrics/scenario.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Sentry.init({
66
release: '1.0.0',
77
environment: 'test',
88
_experiments: {
9-
enableTraceMetrics: true,
9+
enableMetrics: true,
1010
},
1111
transport: loggingTransport,
1212
});

packages/browser/src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class BrowserClient extends Client<BrowserClientOptions> {
110110

111111
const { sendDefaultPii, sendClientReports, enableLogs, _experiments } = this._options;
112112

113-
if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableTraceMetrics)) {
113+
if (WINDOW.document && (sendClientReports || enableLogs || _experiments?.enableMetrics)) {
114114
WINDOW.document.addEventListener('visibilitychange', () => {
115115
if (WINDOW.document.visibilityState === 'hidden') {
116116
if (sendClientReports) {
@@ -119,7 +119,7 @@ export class BrowserClient extends Client<BrowserClientOptions> {
119119
if (enableLogs) {
120120
_INTERNAL_flushLogsBuffer(this);
121121
}
122-
if (_experiments?.enableTraceMetrics) {
122+
if (_experiments?.enableMetrics) {
123123
_INTERNAL_flushMetricsBuffer(this);
124124
}
125125
}
@@ -142,7 +142,7 @@ export class BrowserClient extends Client<BrowserClientOptions> {
142142
});
143143
}
144144

145-
if (_experiments?.enableTraceMetrics) {
145+
if (_experiments?.enableMetrics) {
146146
this.on('flush', () => {
147147
_INTERNAL_flushMetricsBuffer(this);
148148
});

packages/core/src/metrics/internal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export function _INTERNAL_captureMetric(beforeMetric: Metric, options?: Internal
134134
}
135135

136136
const { release, environment, _experiments } = client.getOptions();
137-
if (!_experiments?.enableTraceMetrics) {
138-
DEBUG_BUILD && debug.warn('trace metrics option not enabled, metric will not be captured.');
137+
if (!_experiments?.enableMetrics) {
138+
DEBUG_BUILD && debug.warn('metrics option not enabled, metric will not be captured.');
139139
return;
140140
}
141141

packages/core/src/metrics/public-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function captureMetric(type: MetricType, name: string, value: number | string, o
3838
}
3939

4040
/**
41-
* @summary Increment a counter metric. Requires the `_experiments.enableTraceMetrics` option to be enabled.
41+
* @summary Increment a counter metric. Requires the `_experiments.enableMetrics` option to be enabled.
4242
*
4343
* @param name - The name of the counter metric.
4444
* @param value - The value to increment by (defaults to 1).
@@ -72,7 +72,7 @@ export function count(name: string, value: number = 1, options?: MetricOptions):
7272
}
7373

7474
/**
75-
* @summary Set a gauge metric to a specific value. Requires the `_experiments.enableTraceMetrics` option to be enabled.
75+
* @summary Set a gauge metric to a specific value. Requires the `_experiments.enableMetrics` option to be enabled.
7676
*
7777
* @param name - The name of the gauge metric.
7878
* @param value - The current value of the gauge.
@@ -106,7 +106,7 @@ export function gauge(name: string, value: number, options?: MetricOptions): voi
106106
}
107107

108108
/**
109-
* @summary Record a value in a distribution metric. Requires the `_experiments.enableTraceMetrics` option to be enabled.
109+
* @summary Record a value in a distribution metric. Requires the `_experiments.enableMetrics` option to be enabled.
110110
*
111111
* @param name - The name of the distribution metric.
112112
* @param value - The value to record in the distribution.

packages/core/src/server-runtime-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class ServerRuntimeClient<
8484
});
8585
}
8686

87-
if (this._options._experiments?.enableTraceMetrics) {
87+
if (this._options._experiments?.enableMetrics) {
8888
// eslint-disable-next-line @typescript-eslint/no-this-alias
8989
const client = this;
9090

packages/core/src/types-hoist/options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
285285
[key: string]: any;
286286

287287
/**
288-
* If trace metrics support should be enabled.
288+
* If metrics support should be enabled.
289289
*
290290
* @default false
291291
* @experimental
292292
*/
293-
enableTraceMetrics?: boolean;
293+
enableMetrics?: boolean;
294294

295295
/**
296296
* An event-processing callback for metrics, guaranteed to be invoked after all other metric

0 commit comments

Comments
 (0)