Skip to content

Commit dd9f8c8

Browse files
author
Luca Forstner
committed
Remove restrictions on unit
1 parent 605fe42 commit dd9f8c8

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

packages/tracing/src/transaction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { getCurrentHub, Hub } from '@sentry/hub';
22
import {
33
Event,
44
Measurements,
5-
MeasurementUnit,
65
Transaction as TransactionInterface,
76
TransactionContext,
87
TransactionMetadata,
@@ -72,10 +71,10 @@ export class Transaction extends SpanClass implements TransactionInterface {
7271
* Set observed measurement for this transaction.
7372
* @param name Name of the measurement
7473
* @param value Value of the measurement
75-
* @param unit Unit of the measurement. (Defaults to 'ms' - milliseconds)
74+
* @param unit Unit of the measurement. (Defaults to an empty string)
7675
* @hidden
7776
*/
78-
public setMeasurement(name: string, value: number, unit: MeasurementUnit = 'ms'): void {
77+
public setMeasurement(name: string, value: number, unit: string = ''): void {
7978
this._measurements[name] = { value, unit };
8079
}
8180

packages/types/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export { Stacktrace } from './stacktrace';
5454
export {
5555
CustomSamplingContext,
5656
Measurements,
57-
MeasurementUnit,
5857
SamplingContext,
5958
TraceparentData,
6059
Transaction,

packages/types/src/transaction.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ export interface SamplingContext extends CustomSamplingContext {
115115
request?: ExtractedNodeRequestData;
116116
}
117117

118-
export type MeasurementUnit = 'ns' | 'ms' | 's';
119-
export type Measurements = Record<string, { value: number; unit: MeasurementUnit }>;
118+
export type Measurements = Record<string, { value: number; unit: string }>;
120119

121120
export type TransactionSamplingMethod = 'explicitly_set' | 'client_sampler' | 'client_rate' | 'inheritance';
122121

0 commit comments

Comments
 (0)