Skip to content

Commit

Permalink
fix(otlp-transformer): only use BigInt inside hrTimeToNanos()
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc committed Feb 14, 2024
1 parent f86251d commit 32eb526
Showing 1 changed file with 1 addition and 2 deletions.
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 32eb526

Please sign in to comment.