mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: checkAlerts - add error handling (#177)
This commit is contained in:
parent
807736c7aa
commit
619bd1a952
2 changed files with 24 additions and 10 deletions
5
.changeset/eleven-peaches-scream.md
Normal file
5
.changeset/eleven-peaches-scream.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/api': patch
|
||||
---
|
||||
|
||||
fix: checkAlerts - add error handling
|
||||
|
|
@ -485,16 +485,25 @@ export const processAlert = async (now: Date, alert: AlertDocument) => {
|
|||
checkData,
|
||||
});
|
||||
|
||||
await fireChannelEvent({
|
||||
alert,
|
||||
dashboard: targetDashboard,
|
||||
endTime: fns.addMinutes(bucketStart, windowSizeInMins),
|
||||
group: checkData.group,
|
||||
logView,
|
||||
startTime: bucketStart,
|
||||
totalCount,
|
||||
windowSizeInMins,
|
||||
});
|
||||
try {
|
||||
await fireChannelEvent({
|
||||
alert,
|
||||
dashboard: targetDashboard,
|
||||
endTime: fns.addMinutes(bucketStart, windowSizeInMins),
|
||||
group: checkData.group,
|
||||
logView,
|
||||
startTime: bucketStart,
|
||||
totalCount,
|
||||
windowSizeInMins,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error({
|
||||
message: 'Failed to fire channel event',
|
||||
alert,
|
||||
error: serializeError(e),
|
||||
});
|
||||
}
|
||||
|
||||
history.counts += 1;
|
||||
}
|
||||
history.lastValues.push({ count: totalCount, startTime: bucketStart });
|
||||
|
|
|
|||
Loading…
Reference in a new issue