File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88---
99
10+ ## [ 0.4.2] - 2026-03-18
11+
12+ ### Fixed
13+ - ** ` scaffold sre ` empty ` slos: [] ` when ` --slo-type error_rate ` ** — ` generate_slo_manifest() ` in
14+ ` cli/scaffold_sre.py ` had no branch for the ` error_rate ` SLO type, leaving ` slo.yaml ` with an
15+ empty ` slos: [] ` list. Sloth/OpenSLO tooling therefore received no SLO objectives. A dedicated
16+ ` error_rate ` SLO entry (with matching SLI queries and alerting config) is now generated when
17+ ` --slo-type error_rate ` is specified.
18+
19+ ---
20+
1021## [ 0.4.1] - 2026-03-17
1122
1223### Changed
Original file line number Diff line number Diff line change @@ -347,6 +347,28 @@ def generate_slo_manifest(args):
347347 },
348348 })
349349
350+ if args .slo_type in ("error_rate" ,):
351+ slos .append ({
352+ "name" : "error_rate" ,
353+ "description" : f"{ name } error rate SLO — error rate stays below { round (100 - args .slo_target , 4 )} %" ,
354+ "objective" : args .slo_target ,
355+ "sli" : {
356+ "events" : {
357+ "error_query" : f"rate(http_requests_total{{job=\" { name } \" ,status=~\" (5..)\" }}[{{{{.window}}}}])" ,
358+ "total_query" : f"rate(http_requests_total{{job=\" { name } \" }}[{{{{.window}}}}])" ,
359+ }
360+ },
361+ "alerting" : {
362+ "name" : f"{ name .title ()} ErrorRateSLO" ,
363+ "labels" : {"team" : args .team },
364+ "annotations" : {
365+ "runbook" : f"https://wiki.example.com/runbooks/{ name } /error-rate" ,
366+ },
367+ "page_alert" : {"labels" : {"severity" : "critical" }},
368+ "ticket_alert" : {"labels" : {"severity" : "warning" }},
369+ },
370+ })
371+
350372 if args .slo_type in ("latency" , "all" ):
351373 slos .append ({
352374 "name" : "latency" ,
Original file line number Diff line number Diff line change @@ -854,16 +854,6 @@ def test_slo_manifest_latency_entry(self):
854854 slo_names = [s ["name" ] for s in manifest ["slos" ]]
855855 assert "latency" in slo_names
856856
857- # BUG-2: error_rate SLO type produces empty slos list in manifest
858- @pytest .mark .xfail (
859- strict = True ,
860- reason = (
861- "BUG-2: generate_slo_manifest() only checks for 'availability' and "
862- "'latency' slo_type values. When slo_type='error_rate', neither "
863- "condition matches so the slos list is empty. An error_rate SLO "
864- "entry should be generated for slo_type='error_rate'."
865- ),
866- )
867857 def test_slo_manifest_error_rate_bug (self ):
868858 """
869859 BUG-2: When slo_type='error_rate', generate_slo_manifest() should
You can’t perform that action at this time.
0 commit comments