Skip to main content

Crate weirdnet_alerts

Crate weirdnet_alerts 

Source
Expand description

Node health alerts: rule packs over observations, dedupe with recovery notices, and sinks.

Rules are weirdnet_rules::RuleSpecs; only the spec, matching and comparison parts of weirdnet-rules are used, so the alerter is Send and can live in an async daemon.

  • Alerter: matches Observations against rules, dedupes per key (a failing key alerts at most once per repeat interval) and sends one recovery notice when it clears.
  • rules::default_rules: engine, route, disk and GPU rules.
  • sinks: SMTP, JSON webhooks, the log, memory, and (feature push) phone wakes through weirdnet-push. Every network sink has a dry-run mode.
  • probe: default route, free disk and GPU temperature probes.
  • config::AlertsConfig: a TOML/serde config that builds the alerter and its sinks; secrets are references (env:NAME, file:/path), never values.
  • backends feature: engine::observation turns weirdnet-backends supervisor events into observations, and engine::monitor feeds them and the probes to an alerter.

Re-exports§

pub use config::AlertsConfig;
pub use sinks::PushSink;
pub use sinks::LogSink;
pub use sinks::MemorySink;
pub use sinks::Sink;
pub use sinks::SmtpSink;
pub use sinks::WebhookSink;

Modules§

config
The alerts section of an application’s config (TOML or any serde format).
engine
weirdnet-backends engines as alert observations (feature backends).
probe
Health probes that turn into Observations.
rules
The default rule pack: engines, the default route, free disk and GPU temperature, as weirdnet-rules specs.
sinks
Where alerts go.

Structs§

Alert
One message to send.
Alerter
Matches observations against rules, dedupes, and hands alerts to the sinks.
Observation
Something a node saw: kind (engine.crash_loop, net.route, disk) and its fields.

Enums§

Action
What a matching rule does. key and title are templates: {field} from the observation ({host} is always there), plus {now} and {date}.
AlertStatus

Type Aliases§

AlertRule