Skip to content

Commit 477e2a4

Browse files
committed
make unit optional
1 parent eae5a24 commit 477e2a4

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

packages/core/src/metrics/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DsnComponents, DynamicSamplingContext, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types'
1+
import type { DsnComponents, DynamicSamplingContext, SdkMetadata, StatsdEnvelope, StatsdItem } from '@sentry/types';
22
import { createEnvelope, dropUndefinedKeys, dsnToString } from '@sentry/utils';
33

44
/**

packages/types/src/envelope.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,11 @@ export type ReplayEnvelope = [ReplayEnvelopeHeaders, [ReplayEventItem, ReplayRec
109109
export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
110110
export type StatsdEnvelope = BaseEnvelope<StatsdEnvelopeHeaders, StatsdItem>;
111111

112-
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEnvelope | StatsdEnvelope;
112+
export type Envelope =
113+
| EventEnvelope
114+
| SessionEnvelope
115+
| ClientReportEnvelope
116+
| ReplayEnvelope
117+
| CheckInEnvelope
118+
| StatsdEnvelope;
113119
export type EnvelopeItem = Envelope[1][number];

packages/types/src/metrics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Primitive } from './misc';
21
import type { MeasurementUnit } from './measurement';
2+
import type { Primitive } from './misc';
33

44
export interface BaseMetric {
55
name: string;
66
timestamp: number;
7-
unit: MeasurementUnit;
7+
unit?: MeasurementUnit;
88
tags?: { [key: string]: Primitive };
99
}
1010

0 commit comments

Comments
 (0)