Expand description
SLO schema, breach detection, and safe-mode enforcement (bd-2xj.2).
Provides machine-readable SLO definitions with data-plane and decision-plane
budgets. Integrates with the metrics registry (BuiltinCounter::SloBreachesTotal)
and structured tracing (slo.check span).
§Architecture
slo.yaml ──parse──▶ SloSchema
│
observations ──▶ check_breach() ──▶ BreachResult
│
batch ──▶ check_safe_mode() ──▶ SafeModeDecision
│
emit_slo_check() ──▶ tracing span + event§Tracing contract
- Span:
slo.checkwith fieldsmetric_name,metric_type,baseline,current,ratio,severity. - WARN event for breach, ERROR event for safe-mode trigger.
- METRICS:
ftui_slo_breaches_totalcounter incremented on breach.
Structs§
- Breach
Result - Result of a breach check for a single metric.
- Metric
Slo - Per-metric SLO definition.
- SloSchema
- Validated SLO configuration parsed from slo.yaml.
Enums§
- Breach
Severity - Severity of a detected breach.
- Metric
Type - Metric type for SLO enforcement.
- Safe
Mode Decision - Safe-mode decision from batch breach evaluation.
- SloSchema
Error - Schema validation error.
Functions§
- check_
breach - Check a single metric observation against its SLO.
- check_
safe_ mode - Evaluate safe-mode trigger from a batch of breach results.
- emit_
slo_ check - Emit a tracing span for SLO check and log appropriate events.
- parse_
slo_ yaml - Parse and validate slo.yaml content.
- run_
slo_ check - Run a full SLO check batch: parse schema, check all metrics, evaluate safe-mode.