pharos/alert
Types
Configuration for a single alert rule gen_statem instance.
Pass to alert_manager.start_link/2.
pub type AlertData {
AlertData(
id: String,
level: AlertLevel,
soak_period_ms: Int,
cool_period_ms: Int,
)
}
Constructors
-
AlertData( id: String, level: AlertLevel, soak_period_ms: Int, cool_period_ms: Int, )Arguments
- id
-
Unique string ID for this alert rule (e.g.
"total_memory"). - level
-
Severity level carried in
AlertFiringevents. - soak_period_ms
-
Milliseconds the threshold must stay breached before the alert fires. Set to
0to skip thePendingstate and fire immediately. - cool_period_ms
-
Milliseconds recovery must hold before the alert resolves.
Events broadcast over the gen_event alert dispatcher bus.
pub type AlertEvent {
AlertFiring(id: String, level: AlertLevel, diagnostic: String)
AlertResolved(id: String)
}
Constructors
-
AlertFiring(id: String, level: AlertLevel, diagnostic: String)Threshold has been continuously breached for longer than
soak_period_ms.diagnosticis a snapshot of VM state captured at the moment the soak timer fires. -
AlertResolved(id: String)System recovered and stayed healthy for at least
cool_period_ms.
Alert severity level attached to a firing alert.
pub type AlertLevel {
Warning
Critical
}
Constructors
-
Warning -
Critical
The four states of the alert lifecycle state machine.
pub type AlertState {
Clear
Pending
Firing
Cooling
}
Constructors
-
ClearSystem is healthy; no timer running.
-
PendingThreshold just breached; soak timer is counting down.
-
FiringAlert is active - threshold was breached for the full soak period.
-
CoolingSystem recovered; cool-down timer is counting down.