fix(otlp-transformer): only use BigInt inside hrTimeToNanos() (#4484)

* fix(otlp-transformer): only use BigInt inside hrTimeToNanos()

* fix: changelog
This commit is contained in:
Marc Pichler 2024-02-15 14:04:35 +01:00 committed by GitHub
parent 8bbebfd191
commit 5bc8cedbd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -18,6 +18,7 @@ All notable changes to experimental packages in this project will be documented
* fix(sdk-node): allow using samplers when the exporter is defined in the environment [#4394](https://github.com/open-telemetry/opentelemetry-js/pull/4394) @JacksonWeber
* fix(instrumentation): normalize paths for internal files in scoped packages [#4467](https://github.com/open-telemetry/opentelemetry-js/pull/4467) @pichlermarc
* Fixes a bug where, on Windows, internal files on scoped packages would not be instrumented.
* fix(otlp-transformer): only use BigInt inside hrTimeToNanos() [#4484](https://github.com/open-telemetry/opentelemetry-js/pull/4484) @pichlermarc
### :books: (Refine Doc)

View File

@ -18,9 +18,8 @@ import type { OtlpEncodingOptions, Fixed64, LongBits } from './types';
import { HrTime } from '@opentelemetry/api';
import { hexToBinary, hrTimeToNanoseconds } from '@opentelemetry/core';
const NANOSECONDS = BigInt(1_000_000_000);
export function hrTimeToNanos(hrTime: HrTime): bigint {
const NANOSECONDS = BigInt(1_000_000_000);
return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]);
}