Skip to content

Commit 792386c

Browse files
committed
remove metrics summary
1 parent edbb214 commit 792386c

File tree

14 files changed

+3
-313
lines changed

14 files changed

+3
-313
lines changed

dev-packages/browser-integration-tests/suites/metrics/timing/test.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,6 @@ sentryTest('allows to wrap sync methods with a timing metric', async ({ getLocal
6767
expect(span.op).toEqual('metrics.timing');
6868
expect(span.description).toEqual('timingSync');
6969
expect(span.timestamp! - span.start_timestamp).toEqual(duration);
70-
expect(span._metrics_summary).toEqual({
71-
'd:timingSync@second': [
72-
{
73-
count: 1,
74-
max: duration,
75-
min: duration,
76-
sum: duration,
77-
tags: {
78-
release: '1.0.0',
79-
transaction: 'manual span',
80-
},
81-
},
82-
],
83-
});
8470
});
8571

8672
sentryTest('allows to wrap async methods with a timing metric', async ({ getLocalTestUrl, page }) => {
@@ -142,18 +128,4 @@ sentryTest('allows to wrap async methods with a timing metric', async ({ getLoca
142128
expect(span.op).toEqual('metrics.timing');
143129
expect(span.description).toEqual('timingAsync');
144130
expect(span.timestamp! - span.start_timestamp).toEqual(duration);
145-
expect(span._metrics_summary).toEqual({
146-
'd:timingAsync@second': [
147-
{
148-
count: 1,
149-
max: duration,
150-
min: duration,
151-
sum: duration,
152-
tags: {
153-
release: '1.0.0',
154-
transaction: 'manual span',
155-
},
156-
},
157-
],
158-
});
159131
});

dev-packages/node-integration-tests/suites/tracing/metric-summaries/scenario.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/tracing/metric-summaries/test.ts

Lines changed: 0 additions & 91 deletions
This file was deleted.

dev-packages/rollup-utils/plugins/bundlePlugins.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ export function makeTerserPlugin() {
126126
'_sentryId',
127127
// Keeps the frozen DSC on a Sentry Span
128128
'_frozenDsc',
129-
// This keeps metrics summary on spans
130-
'_metrics_summary',
131129
// These are used to keep span & scope relationships
132130
'_sentryRootSpan',
133131
'_sentryChildSpans',

packages/core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export { profiler } from './profiling';
110110
// eslint-disable-next-line deprecation/deprecation
111111
export { metricsDefault } from './metrics/exports-default';
112112
export { BrowserMetricsAggregator } from './metrics/browser-aggregator';
113-
export { getMetricSummaryJsonForSpan } from './metrics/metric-summary';
114113
export {
115114
// eslint-disable-next-line deprecation/deprecation
116115
addTracingHeadersToFetchRequest,

packages/core/src/metrics/aggregator.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Client, MeasurementUnit, MetricsAggregator as MetricsAggregatorBase, Primitive } from '../types-hoist';
22
import { timestampInSeconds } from '../utils-hoist/time';
3-
import { updateMetricSummaryOnActiveSpan } from '../utils/spanUtils';
4-
import { DEFAULT_FLUSH_INTERVAL, MAX_WEIGHT, SET_METRIC_TYPE } from './constants';
3+
import { DEFAULT_FLUSH_INTERVAL, MAX_WEIGHT } from './constants';
54
import { captureAggregateMetrics } from './envelope';
65
import { METRIC_MAP } from './instance';
76
import type { MetricBucket, MetricType } from './types';
@@ -67,9 +66,6 @@ export class MetricsAggregator implements MetricsAggregatorBase {
6766
const bucketKey = getBucketKey(metricType, name, unit, tags);
6867

6968
let bucketItem = this._buckets.get(bucketKey);
70-
// If this is a set metric, we need to calculate the delta from the previous weight.
71-
const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
72-
7369
if (bucketItem) {
7470
bucketItem.metric.add(value);
7571
// TODO(abhi): Do we need this check?
@@ -89,10 +85,6 @@ export class MetricsAggregator implements MetricsAggregatorBase {
8985
this._buckets.set(bucketKey, bucketItem);
9086
}
9187

92-
// If value is a string, it's a set metric so calculate the delta from the previous weight.
93-
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
94-
updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
95-
9688
// We need to keep track of the total weight of the buckets so that we can
9789
// flush them when we exceed the max weight.
9890
this._bucketsTotalWeight += bucketItem.metric.weight;

packages/core/src/metrics/browser-aggregator.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Client, MeasurementUnit, MetricsAggregator, Primitive } from '../types-hoist';
22
import { timestampInSeconds } from '../utils-hoist/time';
3-
import { updateMetricSummaryOnActiveSpan } from '../utils/spanUtils';
4-
import { DEFAULT_BROWSER_FLUSH_INTERVAL, SET_METRIC_TYPE } from './constants';
3+
import { DEFAULT_BROWSER_FLUSH_INTERVAL } from './constants';
54
import { captureAggregateMetrics } from './envelope';
65
import { METRIC_MAP } from './instance';
76
import type { MetricBucket, MetricType } from './types';
@@ -44,9 +43,6 @@ export class BrowserMetricsAggregator implements MetricsAggregator {
4443
const bucketKey = getBucketKey(metricType, name, unit, tags);
4544

4645
let bucketItem = this._buckets.get(bucketKey);
47-
// If this is a set metric, we need to calculate the delta from the previous weight.
48-
const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
49-
5046
if (bucketItem) {
5147
bucketItem.metric.add(value);
5248
// TODO(abhi): Do we need this check?
@@ -65,10 +61,6 @@ export class BrowserMetricsAggregator implements MetricsAggregator {
6561
};
6662
this._buckets.set(bucketKey, bucketItem);
6763
}
68-
69-
// If value is a string, it's a set metric so calculate the delta from the previous weight.
70-
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
71-
updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
7264
}
7365

7466
/**

packages/core/src/metrics/metric-summary.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

packages/core/src/tracing/sentrySpan.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getClient, getCurrentScope } from '../currentScopes';
22
import { DEBUG_BUILD } from '../debug-build';
33
import { createSpanEnvelope } from '../envelope';
4-
import { getMetricSummaryJsonForSpan } from '../metrics/metric-summary';
54
import {
65
SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,
76
SEMANTIC_ATTRIBUTE_PROFILE_ID,
@@ -233,7 +232,6 @@ export class SentrySpan implements Span {
233232
timestamp: this._endTime,
234233
trace_id: this._traceId,
235234
origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] as SpanOrigin | undefined,
236-
_metrics_summary: getMetricSummaryJsonForSpan(this),
237235
profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID] as string | undefined,
238236
exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] as number | undefined,
239237
measurements: timedEventsToMeasurements(this._events),
@@ -385,7 +383,6 @@ export class SentrySpan implements Span {
385383
dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),
386384
}),
387385
},
388-
_metrics_summary: getMetricSummaryJsonForSpan(this),
389386
...(source && {
390387
transaction_info: {
391388
source,

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { RequestEventData } from './request';
1313
import type { CaptureContext, Scope } from './scope';
1414
import type { SdkInfo } from './sdkinfo';
1515
import type { SeverityLevel } from './severity';
16-
import type { MetricSummary, SpanJSON } from './span';
16+
import type { SpanJSON } from './span';
1717
import type { Thread } from './thread';
1818
import type { TransactionSource } from './transaction';
1919
import type { User } from './user';
@@ -82,7 +82,6 @@ export interface ErrorEvent extends Event {
8282
}
8383
export interface TransactionEvent extends Event {
8484
type: 'transaction';
85-
_metrics_summary?: Record<string, Array<MetricSummary>>;
8685
}
8786

8887
/** JSDoc */

0 commit comments

Comments
 (0)