Skip to main content

Module sla

Module sla 

Source
Expand description

Data-freshness & volume SLA monitoring (#202).

The top-level sla: block declares freshness/volume expectations for a pipeline; the executor evaluates them after every root invocation (faucet run, schedule, serve, and replicate all flow through crate::executor::run_expanded, so every runtime gets the same evaluation). Violations emit faucet_pipeline_sla_violations_total{pipeline,row,kind} and a structured warning — they never fail or abort the run. faucet doctor additionally reports staleness / baseline health read-only.

Module layout (mirrors schedule/ / replication/):

  • spec — serde config types + validation (faucet schema sla).
  • state — the persisted history ({state_key}::__sla__).
  • eval — pure staleness / floor / anomaly math.
  • metrics — the Prometheus surface.

Re-exports§

pub use eval::SlaViolation;
pub use spec::AnomalyMethod;
pub use spec::SlaSpec;
pub use spec::VolumeAnomalySpec;
pub use state::SLA_STATE_SUFFIX;
pub use state::SlaState;
pub use state::sla_state_key;

Modules§

eval
Pure SLA evaluation: staleness, static volume floor, and learned-baseline volume anomaly detection (z-score / Tukey IQR fences). No I/O — the orchestration in sla::evaluate_post_run owns state loading/persisting.
metrics
Prometheus surface for SLA monitoring (#202).
spec
Config types for the top-level sla: block (#202).
state
Persisted SLA history: last-success timestamp + rolling volume baseline.

Enums§

RunOutcome
How the run being evaluated ended.

Functions§

doctor_probes
Read-only SLA probes for faucet doctor (and serve’s doctor_first): staleness of the last recorded success and volume-baseline warm-up state. min_rows_per_run has nothing to probe without a run, so it is not represented here.
evaluate_post_run
Post-run SLA evaluation for one root invocation: load prior history, evaluate, persist the updated baseline on success, and emit metrics/warnings for every violation. Returns the violations found.