Skip to main content

faucet_cli/notify/
mod.rs

1//! Notification / incident-routing layer (#280).
2//!
3//! A declarative top-level `notifications:` block fans pipeline lifecycle and
4//! health events out to Slack / PagerDuty / a generic signed webhook. It works
5//! from every runtime (`run` / `schedule` / `serve` / `replicate`) because the
6//! emit sites live in the shared executor + SLA pass; the scheduler adds a
7//! `scheduler_stuck` signal.
8//!
9//! **Notifications never fail or block a run.** A channel outage is retried a
10//! little, then logged + counted (`faucet_notifications_dropped_total`) and
11//! swallowed — the same log-and-continue contract as lineage and SLA.
12//!
13//! Module layout (mirrors `sla/` / `schedule/`):
14//! - [`spec`] — serde config types + validation (`faucet schema notifications`).
15//! - [`event`] — the channel-agnostic [`NotifyEvent`] + its constructors.
16//! - [`render`] — pure per-channel payload rendering.
17//! - [`channels`] — the one-request-each HTTP shims.
18//! - [`dispatch`] — the [`Notifier`]: match → coalesce → deliver → resolve.
19//! - [`metrics`] — the `faucet_notifications_*` surface.
20//!
21//! Channel secrets (Slack webhook URL, PD routing key, webhook HMAC secret)
22//! should be supplied via `${env:...}` / `${file:...}` / `${secret:...}`, which
23//! are resolved over the raw document at load time and registered for log
24//! redaction.
25
26pub mod channels;
27pub mod dispatch;
28pub mod event;
29pub mod metrics;
30pub mod render;
31pub mod spec;
32
33pub use dispatch::Notifier;
34pub use event::NotifyEvent;
35pub use spec::{
36    ChannelSpec, EventKind, NotificationSpec, PagerdutyConfig, Severity, SlackConfig,
37    WebhookConfig, validate_all,
38};