Skip to content

Commit

Permalink
Remove restrictions on unit
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Apr 12, 2022
1 parent 605fe42 commit dd9f8c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/tracing/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { getCurrentHub, Hub } from '@sentry/hub';
import {
Event,
Measurements,
MeasurementUnit,
Transaction as TransactionInterface,
TransactionContext,
TransactionMetadata,
Expand Down Expand Up @@ -72,10 +71,10 @@ export class Transaction extends SpanClass implements TransactionInterface {
* Set observed measurement for this transaction.
* @param name Name of the measurement
* @param value Value of the measurement
* @param unit Unit of the measurement. (Defaults to 'ms' - milliseconds)
* @param unit Unit of the measurement. (Defaults to an empty string)
* @hidden
*/
public setMeasurement(name: string, value: number, unit: MeasurementUnit = 'ms'): void {
public setMeasurement(name: string, value: number, unit: string = ''): void {
this._measurements[name] = { value, unit };
}

Expand Down
1 change: 0 additions & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export { Stacktrace } from './stacktrace';
export {
CustomSamplingContext,
Measurements,
MeasurementUnit,
SamplingContext,
TraceparentData,
Transaction,
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ export interface SamplingContext extends CustomSamplingContext {
request?: ExtractedNodeRequestData;
}

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

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

Expand Down

0 comments on commit dd9f8c8

Please sign in to comment.