Skip to content

Commit

Permalink
fix(sdk-metrics): use Date.now() for instrument recording timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterSquishy committed Dec 28, 2022
1 parent 1c3af6c commit 5821090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sdk-metrics/src/Instruments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()));
}
}

Expand Down

0 comments on commit 5821090

Please sign in to comment.