Skip to content

Commit

Permalink
fix(otlp-transformer): only use BigInt inside hrTimeToNanos() (#4484)
Browse files Browse the repository at this point in the history
* fix(otlp-transformer): only use BigInt inside hrTimeToNanos()

* fix: changelog
  • Loading branch information
pichlermarc authored Feb 15, 2024
1 parent 8bbebfd commit 5bc8ced
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions experimental/packages/otlp-transformer/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 5bc8ced

Please sign in to comment.