Skip to main content

Module alerts

Module alerts 

Source
Expand description

Alert evaluation engine.

Evaluates DOL alert rules against live metric samples. Supports duration guards (e.g. “for 2m”) and actions: print, webhook (HTTP POST), and restart (container restart via bollard).

§Example

let rule = parser::parse(r#"alert when cpu > 80% for 2m then print "High""#)?;
let mut evaluator = AlertEvaluator::new();
let events = evaluator.evaluate_samples(&rule, &samples, Instant::now())?;

Structs§

AlertEvaluator
AlertEvent

Enums§

AlertActionPlan
AlertError

Functions§

duration_to_std
evaluate_alert_once
init_alert_timeouts
Initialise the global alert timeout cache. Should be called once at startup.
render_alert_event