Skip to content

Commit

Permalink
Merge pull request #610 from metrico/fix/undef_time_unix_nano
Browse files Browse the repository at this point in the history
fix for when timeUnixNano is undefined
  • Loading branch information
akvlad authored Jan 29, 2025
2 parents c506c3a + f2338ec commit eebd278
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/handlers/otlp_log_push.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ async function handle (req, res) {
}
const labels = stringify(logAttrs)
const fingerprint = fingerPrint(labels)
const ts = BigInt(logRecord.timeUnixNano)
const ts = logRecord.timeUnixNano
? BigInt(logRecord.timeUnixNano)
: logRecord.observedTimeUnixNano
? BigInt(logRecord.observedTimeUnixNano)
: BigInt(Date.now()) * BigInt(1000000)
promises.push(bulk.add([[
fingerprint,
ts,
Expand Down

0 comments on commit eebd278

Please sign in to comment.