Add detailed emails with check type and recent performance graph
This commit is contained in:
1 parent
117f815e58
commit
08ea842206
2 files changed
+81
-7
No files matched your search
+9
-1
@@ -41,7 +41,15 @@ class Scheduler {
|
||||
);
|
||||
|
||||
if (incident.type !== 'none') {
|
||||
await notificationService.sendAlert(resource, incident);
|
||||
const stats = monitorService.getResourceStats(resource.id, 24);
|
||||
const recentChecks = db.prepare(`
|
||||
SELECT response_time, status FROM checks
|
||||
WHERE resource_id = ?
|
||||
ORDER BY checked_at DESC
|
||||
LIMIT 12
|
||||
`).all(resource.id);
|
||||
stats.recentChecks = recentChecks.reverse();
|
||||
await notificationService.sendAlert(resource, incident, stats);
|
||||
}
|
||||
|
||||
console.log(`Checked ${resource.name}: ${result.status} (${result.response_time}ms)`);
|
||||
|
||||
Reference in new issue
Block a user