diff --git a/packages/sdk-metrics/src/Instruments.ts b/packages/sdk-metrics/src/Instruments.ts index 09e849cc32..817a96a6dc 100644 --- a/packages/sdk-metrics/src/Instruments.ts +++ b/packages/sdk-metrics/src/Instruments.ts @@ -29,7 +29,7 @@ import { ObservableGauge, ObservableUpDownCounter, } from '@opentelemetry/api'; -import { hrTime } from '@opentelemetry/core'; +import { numberToHrtime } from '@opentelemetry/core'; import { InstrumentDescriptor } from './InstrumentDescriptor'; import { ObservableRegistry } from './state/ObservableRegistry'; import { @@ -57,7 +57,7 @@ export class SyncInstrument { ); value = Math.trunc(value); } - this._writableMetricStorage.record(value, attributes, context, hrTime()); + this._writableMetricStorage.record(value, attributes, context, numberToHrtime(Date.now())); } }