Flapping alerts, a noise report and bulk actions with undo
Flapping: an alert raised three times within an hour is announced once as flapping, its further raise/clear messages are held until it has been calm for an hour, and one message then says whether it is still active. Event webhooks still hear everything. The state survives restarts. Alerts > Noise lists the alerts that keep coming back (7-180 days): how often, how long, most in an hour, and a hint on what helps. Bulk actions on Alerts (acknowledge, remove acknowledgement, silence), Servers (tag, silence, runs on) and Inventory (location and dates, print labels). Each reports what it left alone and why, and has an Undo on the toast. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
be6c5552bd
commit
73a06ebe63
35 files changed
+2546
-17
No files matched your search
@@ -510,6 +510,8 @@ export interface HealthCheckSettings {
|
||||
restoreTestDays: number;
|
||||
/** A server that starts listening on a TCP port it did not at first, and that is not noted on its Ports card, is a warning. */
|
||||
newPortAlerts: boolean;
|
||||
/** An alert raised this many times within an hour is "flapping": one message says so and its further messages are held until it has been quiet for an hour. 0 is off. */
|
||||
flapRaises: number;
|
||||
}
|
||||
|
||||
/** The monthly report: last month's availability, incidents, updates and renewals, in one message on a day of the month. */
|
||||
@@ -1244,6 +1246,48 @@ export interface AlertItem {
|
||||
ack?: AlertAck | null;
|
||||
/** The incident record this alert is part of, while it lasts. */
|
||||
incidentId?: number | null;
|
||||
/** Raised and cleared over and over: its raised/cleared messages are being held back. */
|
||||
flapping?: boolean;
|
||||
}
|
||||
|
||||
/** What a bulk action did: how many it changed, what it left alone and why, and the body that puts it back (to send to the same address). */
|
||||
export interface BulkResult {
|
||||
changed: number;
|
||||
skipped: { id: string | number; name: string; reason: string }[];
|
||||
undo: Record<string, unknown> | null;
|
||||
silenced?: { type: string; id: number; name: string }[];
|
||||
}
|
||||
|
||||
/** One alert that fires often, from the incident record. */
|
||||
export interface NoiseRow {
|
||||
alertId: string;
|
||||
message: string;
|
||||
category: AlertCategory;
|
||||
source: string;
|
||||
where: string;
|
||||
fired: number;
|
||||
totalMinutes: number;
|
||||
averageMinutes: number;
|
||||
longestMinutes: number;
|
||||
mostInAnHour: number;
|
||||
flapped: boolean;
|
||||
flappingNow: boolean;
|
||||
openNow: boolean;
|
||||
lastAt: string;
|
||||
link: string | null;
|
||||
hint: string;
|
||||
}
|
||||
export interface NoiseReport {
|
||||
days: number;
|
||||
from: string;
|
||||
to: string;
|
||||
incidents: number;
|
||||
distinctAlerts: number;
|
||||
repeating: number;
|
||||
flapped: number;
|
||||
totalMinutes: number;
|
||||
byCategory: { category: string; incidents: number; repeating: number }[];
|
||||
rows: NoiseRow[];
|
||||
}
|
||||
|
||||
export interface AlertAck {
|
||||
@@ -2049,6 +2093,11 @@ export const api = {
|
||||
start: (data: UpdateRunInput) => request<{ run: UpdateRun }>("/api/update-runs", { method: "POST", body: JSON.stringify(data) }),
|
||||
cancel: (id: number) => request<{ status: string }>(`/api/update-runs/${id}/cancel`, { method: "POST" }),
|
||||
},
|
||||
bulk: {
|
||||
servers: (body: Record<string, unknown>) => request<BulkResult>("/api/servers/bulk", { method: "POST", body: JSON.stringify(body) }),
|
||||
alerts: (body: Record<string, unknown>) => request<BulkResult>("/api/alerts/bulk", { method: "POST", body: JSON.stringify(body) }),
|
||||
inventory: (body: Record<string, unknown>) => request<BulkResult>("/api/inventory/bulk", { method: "POST", body: JSON.stringify(body) }),
|
||||
},
|
||||
patchPlans: {
|
||||
list: () => request<{ plans: PatchPlan[]; runs: PatchPlanRun[]; servers: { id: number; name: string; tags: string[] }[]; tags: string[] }>("/api/patch-plans"),
|
||||
create: (data: PatchPlanInput) => request<{ plan: PatchPlan }>("/api/patch-plans", { method: "POST", body: JSON.stringify(data) }),
|
||||
@@ -2254,6 +2303,7 @@ export const api = {
|
||||
assignees: () => request<{ users: { id: number; name: string; role: string }[] }>("/api/alerts/assignees"),
|
||||
ack: (data: AckInput) => request<{ ack: AlertAck }>("/api/alerts/ack", { method: "PUT", body: JSON.stringify(data) }),
|
||||
unack: (alertId: string) => request<void>(`/api/alerts/ack?alertId=${encodeURIComponent(alertId)}`, { method: "DELETE" }),
|
||||
noise: (days: number) => request<NoiseReport>(`/api/alerts/noise?days=${days}`),
|
||||
},
|
||||
incidents: {
|
||||
list: () => request<{ incidents: IncidentSummary[] }>("/api/incidents"),
|
||||
|
||||
Reference in new issue
Block a user