pass threshold breaches on rather than reconsructing
This commit is contained in:
1 parent
21fb320f3a
commit
91de9e7fb7
4 files changed
+39
-88
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Monitor } from "@/domain/monitors/monitor.type.js";
|
||||
import { HardwareBreaches, Monitor } from "@/domain/monitors/monitor.type.js";
|
||||
import { Check } from "@/domain/checks/check.type.js";
|
||||
import { Job, JobType } from "@/domain/jobs/job.type.js";
|
||||
import { StatusChangeResult } from "@/types/network.js";
|
||||
@@ -13,12 +13,7 @@ export interface MonitorActionDecision {
|
||||
shouldSendNotification: boolean;
|
||||
incidentReason: "status_down" | "threshold_breach" | null;
|
||||
notificationReason: "status_change" | "threshold_breach" | "threshold_resolved" | null;
|
||||
thresholdBreaches?: {
|
||||
cpu?: boolean;
|
||||
memory?: boolean;
|
||||
disk?: boolean;
|
||||
temp?: boolean;
|
||||
};
|
||||
thresholdBreaches?: HardwareBreaches;
|
||||
}
|
||||
|
||||
export type MonitorEvaluation = {
|
||||
|
||||
@@ -320,6 +320,7 @@ export class WorkerPipeline implements IWorkerPipeline {
|
||||
decision.incidentReason = "status_down";
|
||||
decision.notificationReason = "status_change";
|
||||
} else if (monitor.status === "breached") {
|
||||
decision.thresholdBreaches = statusChange.thresholdBreaches;
|
||||
decision.shouldCreateIncident = true;
|
||||
decision.shouldSendNotification = true;
|
||||
decision.incidentReason = "threshold_breach";
|
||||
|
||||
Reference in new issue
Block a user