mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: handle null ratio value (alerting) (#383)
This commit is contained in:
parent
c3bc132d6e
commit
288c763977
2 changed files with 12 additions and 0 deletions
5
.changeset/long-glasses-stare.md
Normal file
5
.changeset/long-glasses-stare.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/api': patch
|
||||
---
|
||||
|
||||
fix: handle null ratio value (alerting)
|
||||
|
|
@ -801,8 +801,15 @@ export const processAlert = async (now: Date, alert: AlertDocument) => {
|
|||
createdAt: nowInMinsRoundDown,
|
||||
state: alertState,
|
||||
}).save();
|
||||
|
||||
if (checksData?.rows && checksData?.rows > 0) {
|
||||
for (const checkData of checksData.data) {
|
||||
// TODO: we might want to fix the null value from the upstream
|
||||
// this happens when the ratio is 0/0
|
||||
if (checkData.data == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const totalCount = isString(checkData.data)
|
||||
? parseInt(checkData.data)
|
||||
: checkData.data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue