diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index ab698812ef..64336d36d5 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -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) diff --git a/experimental/packages/otlp-transformer/src/common/index.ts b/experimental/packages/otlp-transformer/src/common/index.ts index 00dcccfb05..96d281bad6 100644 --- a/experimental/packages/otlp-transformer/src/common/index.ts +++ b/experimental/packages/otlp-transformer/src/common/index.ts @@ -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]); }