Skip to content

Commit

Permalink
Merge pull request #419 from metrico/filter_nan
Browse files Browse the repository at this point in the history
filter nan values on ingestion
  • Loading branch information
akvlad authored Jan 2, 2024
2 parents 819bda4 + 1ba932a commit 8ff76c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/handlers/influx_write.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ async function handler (req, res) {
asyncLogError('no bulkable data', req.log)
return res.code(204).send('')
}
if (typeof value === 'number' && isNaN(value)) {
return
}
const values = [
finger,
BigInt(pad('0000000000000000000', timestamp, true)),
Expand All @@ -116,7 +119,7 @@ async function handler (req, res) {
]
bulk.add([values])
}
/* logs or syslog */
/* logs or syslog */
} else if (stream.measurement === 'syslog' || JSONFields.message) {
// Send fields as a JSON object for qryn to parse
// const message = JSON.stringify(JSONFields)
Expand Down
3 changes: 3 additions & 0 deletions lib/handlers/prom_push.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ async function handler (req, res) {
asyncLogError({ entry }, req.log)
return
}
if (isNaN(entry.value)) {
return
}
const ts = BigInt(entry.timestamp)
const values = [
finger,
Expand Down

0 comments on commit 8ff76c2

Please sign in to comment.