lightspeed/ops/slo_autopilot
SLO burn-rate and mitigation-control contracts for M30.
Types
Burn-rate observation for one service/SLO target.
pub type BurnRateSample {
BurnRateSample(
service: String,
slo_name: String,
short_window_milli: Int,
long_window_milli: Int,
hotspot_tenant_id: String,
)
}
Constructors
-
BurnRateSample( service: String, slo_name: String, short_window_milli: Int, long_window_milli: Int, hotspot_tenant_id: String, )
Mitigation controls managed by the autopilot runtime.
pub type Control {
ShedEvents(percent: Int)
PauseBackgroundJobs
IsolateHotspotTenant(tenant_id: String)
EnterReadOnlyMode
}
Constructors
-
ShedEvents(percent: Int) -
PauseBackgroundJobs -
IsolateHotspotTenant(tenant_id: String) -
EnterReadOnlyMode
Auditable runtime decision.
pub type Decision {
Applied
RolledBack
Noop(reason: String)
}
Constructors
-
Applied -
RolledBack -
Noop(reason: String)
Runtime
opaqueSLO autopilot runtime.
pub opaque type Runtime
Burn-rate status classification.
pub type Status {
Healthy
Warning
Critical
}
Constructors
-
Healthy -
Warning -
Critical
Threshold profile for burn-rate evaluation.
pub type Thresholds {
Thresholds(
warn_short_milli: Int,
warn_long_milli: Int,
critical_short_milli: Int,
critical_long_milli: Int,
)
}
Constructors
-
Thresholds( warn_short_milli: Int, warn_long_milli: Int, critical_short_milli: Int, critical_long_milli: Int, )
Values
pub fn apply(
runtime: Runtime,
control: Control,
actor_id: String,
reason: String,
at_ms: Int,
status: Status,
) -> Runtime
Apply one control with an audit trail entry.
pub fn audit_entries(runtime: Runtime) -> List(AuditEntry)
Audit entries in stable order.
pub fn audit_metric(entry: AuditEntry) -> telemetry.Metric
Convert one audit entry into a metric point.
pub fn classify(
sample: BurnRateSample,
thresholds: Thresholds,
) -> Status
Classify one burn-rate sample against thresholds.
pub fn evaluate(
runtime: Runtime,
sample: BurnRateSample,
actor_id: String,
now_ms: Int,
) -> #(Runtime, Status)
Evaluate one sample and reconcile active controls.
pub fn recommended_controls(
sample: BurnRateSample,
status: Status,
) -> List(Control)
Desired controls for one sample/status pair.
pub fn reversible(control: Control) -> Bool
Return True when one control can be rolled back.
pub fn rollback(
runtime: Runtime,
control: Control,
actor_id: String,
reason: String,
at_ms: Int,
status: Status,
) -> Runtime
Roll back one control with an audit trail entry.
pub fn sample(
service: String,
slo_name: String,
short_window_milli: Int,
long_window_milli: Int,
hotspot_tenant_id: String,
) -> BurnRateSample
Build one burn-rate sample.
pub fn signature(runtime: Runtime) -> String
Stable runtime signature for deterministic fixtures.
pub fn thresholds(
warn_short_milli: Int,
warn_long_milli: Int,
critical_short_milli: Int,
critical_long_milli: Int,
) -> Thresholds
Build one threshold profile.