build notifications for container breaches

This commit is contained in:
Alex Holliday committed 2026-09-23 10:54:35 -07:00
1 parent a75bb5fae6
commit 4ea6539a7d
6 files changed
+122 -21

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ export interface MonitorActionDecision {
shouldResolveIncident: boolean;
shouldSendNotification: boolean;
incidentReason: "status_down" | "threshold_breach" | null;
notificationReason: "status_change" | "threshold_breach" | null;
notificationReason: "status_change" | "threshold_breach" | "threshold_resolved" | null;
thresholdBreaches?: {
cpu?: boolean;
memory?: boolean;
+5 -1
View File
@@ -326,7 +326,11 @@ export class WorkerPipeline implements IWorkerPipeline {
decision.shouldSendNotification = true;
decision.incidentReason = "threshold_breach";
decision.notificationReason = "threshold_breach";
} else if (monitor.status === "up" && (prevStatus === "down" || prevStatus === "breached")) {
} else if (monitor.status === "up" && prevStatus === "breached") {
decision.shouldResolveIncident = true;
decision.shouldSendNotification = true;
decision.notificationReason = "threshold_resolved";
} else if (monitor.status === "up" && prevStatus === "down") {
decision.shouldResolveIncident = true;
decision.shouldSendNotification = true;
decision.notificationReason = "status_change";