Repository navigation
Description
Update 2026-11-26 (infra move): The product Sloth specs are in k8s/devops/monitoring/slos/.
k8s/monitoring/ moved to dan-petty/homelab.
Problem or Motivation
The owner asked that the project review shows Service job performance in SRE terms: SLIs and SLOs with error budgets and burn rates, the four golden signals, toil and capacity. A period with an incident or a large failure gets a postmortem-style section. The Sloth recording rules use fixed windows, and no library computes the budget and the burn rate for a past window of any length.
Proposed Solution & Architectural Design
- Read the Sloth spec (feat(monitoring): define the Service SLOs in a Sloth spec #4709) and put the review window into
{{.window}}, with{repo}. - Compute events, bad events, budget = (1 - objective) x events, budget used, and burn = error ratio / (1 - objective). The 1 h and 6 h series come from
query_range, or from theslo:*rules where they cover the window. - Low-sample rule: fewer than 20 events in the long window gives "low sample" and no trigger.
- Add the golden-signal, toil and capacity facts to the catalog.
- Put the incident trigger rules in the catalog, with the values that the owner decided on 2026-11-11 (SRE workbook values):
- a burn rate of 14.4x or more for 1 h or more, with at least 20 events;
- 50% or more of an SLO budget used in the window;
- a critical alert or NodeNotReady for 30 min or more;
- a revert commit on main.
- Add the data of the postmortem section: summary, impact, a UTC timeline from
ALERTSchanges, releases,k8s/commits and the ERROR lines, root cause, and action items as linked issues or candidates. - The SLO table shows SLO, SLI definition, objective, events, bad events, SLI, budget, budget used, budget left, and the status as a word (met, at risk, breached).
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/project_review/), with the Sloth spec of k8s/devops/monitoring/slos/.
Existing Tool Considered
Sloth (the SLO spec and the recording rules) and the Prometheus HTTP API (query_range) cover the data. No library computes a budget and burn rate for a past window of any length, so the review adds about 40 lines of SLO math. Cost (estimate): about 200-300 lines with tests, one issue-size item, about 0.33-0.50 USD on the DeepSeek implement path and 1-2 days elapsed.
Acceptance Criteria
Fixture tests:
- 3 errors in 5 events at 99% gives burn 60 and "low sample", and no trigger;
- a NodeNotReady fixture of 30 min adds the incident section;
- a revert commit on main adds the incident section;
- every SRE number names its query in
data.json.
The 7-day devops-cli stage SLI equals the PromQL value 0.372.
Dependencies
- feat(roadmap): read project review facts through a catalog #4692 feat(roadmap): read project review facts through a catalog.
- feat(monitoring): define the Service SLOs in a Sloth spec #4709 feat(monitoring): define the Service SLOs in a Sloth spec.
Source: #4679
Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: slok/sloth (https://github.com/slok/sloth), Apache-2.0, last activity 2026-10-28, maintained.
Reason: Searches found Sloth, already in use, and Pyrra. Both generate fixed-window Prometheus SLO rules and neither computes the budget or burn rate of an arbitrary past review window, nor the golden-signal, toil, capacity or postmortem facts.
Covers:
- SLO spec with objective and event-based SLI queries
- Autogenerated SLI and SLO metadata recording rules
- Multi-window multi-burn alert rules for fixed windows
Lacks:
- Budget and burn rate for an arbitrary past review window
- Golden-signal, toil and capacity facts
- Incident postmortem timeline and action items
- Low-sample rule and met, at risk, breached status words
Proposed design
Problem statement
The project review shows no SRE view of the Service. The owner asks for SLIs, SLOs, error budgets, burn rates, the four golden signals, toil, capacity and a postmortem section after an incident. Sloth supplies the SLO spec and fixed-window rules only, so the review must compute the SLO math for the review window, read the incident trigger settings and build the incident section. Three parts move to their own issues: the Alertmanager silence match with the critical-alert trigger, the golden-signal and capacity facts, and the toil facts.
Acceptance criteria
Requirement: SLO math for the review window
The project review SHALL compute the events, the bad events, the budget, the budget used and the burn rate of each SLO for the review window from the SLI query of the Sloth spec, with {repo} and the review window in place of {{.window}}.
Scenario: Three bad events in five events
- WHEN A fixture gives 5 events and 3 bad events at an objective of 0.99.
- THEN
data.jsonholds the burn rate 60 and the SLO row sayslow sample.
Requirement: Low-sample rule
The review MUST mark an SLO as low sample and SHALL add no incident section when its long window holds fewer than 20 events.
Scenario: Nineteen events in the long window
- WHEN A fixture gives 19 events in the long window and a burn rate of 14.4.
- THEN The SLO row says
low sampleand the review adds no incident section.
Requirement: Incident from a burn rate
The review SHALL add the incident section when an SLO burn rate is at or above the burn-rate trigger of the review settings for 1 hour or more and the long window holds at least 20 events.
Scenario: Burn rate 14.4 with 20 events
- WHEN A fixture gives 20 events and a burn rate of 14.4 for 1 hour, with the default burn-rate trigger of 14.4.
- THEN The review adds the incident section.
Requirement: Incident from budget use
The review SHALL add the incident section when an SLO uses 50 % or more of its budget in the review window.
Scenario: Half the budget used
- WHEN A fixture gives an SLO with 50 % of its budget used and at least 20 events.
- THEN The review adds the incident section.
Requirement: Incident from a revert commit
The review SHALL add the incident section when main holds a revert commit in the review window.
Scenario: Revert commit on main
- WHEN A fixture holds a revert commit on
mainin the review window. - THEN The review adds the incident section and lists that commit in the UTC timeline.
Requirement: Each SRE number names its query
The review MUST write the PromQL query of each SRE number in data.json.
Scenario: Query beside each number
- WHEN The review renders a fixture with a burn-rate trigger, a release and a revert commit.
- THEN Each SRE number in
data.jsonhas its PromQL query beside it.
Requirement: SLO table columns and status word
The SLO table SHALL show the SLO, the SLI definition, the objective, the events, the bad events, the SLI, the budget, the budget used, the budget left and the status as a word.
Scenario: Met, at risk and breached
- WHEN A fixture holds one SLO with more than 25 % of its budget left, one with 0 to 25 % left and one with less than 0 % left.
- THEN The table shows the status
met,at riskandbreached, in that order.
Requirement: Trigger values from the settings
The review SHALL read each incident trigger threshold from the settings of the review run and SHALL keep the owner values of 2026-11-11 as their defaults.
Scenario: A changed trigger threshold
- WHEN A review run uses a settings fixture with the burn-rate trigger 10.
- THEN The review compares the burn rate with 10 and adds no incident section for a burn rate of 9.
Requirement: Documented trigger settings
The change SHALL document each incident trigger setting in docs/CONFIGURATION.md and docs/ENV_VARS.md.
Scenario: Generated configuration docs
- WHEN
uv run devops docs checkruns after the trigger settings are added. - THEN The command passes and the generated
docs/CONFIGURATION.mdnamesroadmap.project_review.incident_triggerswith the owner values.
Requirement: 7-day stage SLI
The review SHALL compute the 7-day stage SLI of devops-cli from the query_range response of the review window.
Scenario: Recorded seven-day range
- WHEN A recorded
query_rangeresponse gives the good and total counts of the stage window. - THEN The stage SLO row shows the SLI 0.372.
Requirement: Incident section data
The incident section SHALL hold the summary, the impact with the SLI and the budget used, a UTC timeline, the root cause and the action items, in the tables of docs/DESIGN.md T10.
Scenario: Timeline in UTC order
- WHEN A fixture holds an
ALERTSchange, a release, ak8s/commit and an ERROR line in the review window. - THEN The timeline lists the 4 events in UTC order and each action item links an issue or a candidate.
Existing Tool Considered
slok/sloth (https://github.com/slok/sloth, Apache-2.0, maintained) is the SLO tool, and the alternatives check of 2026-11-26 gives the verdict in-use; its block lists what Sloth lacks for this review. The review builds those parts itself: about 40 lines of SLO math and about 200-300 lines with tests, about 0.33-0.50 USD on the DeepSeek implement path and 1-2 days elapsed. Three parts of the issue move to their own issues.
Key questions
- How does the proposal fix the step that held 67339 tokens?: The proposal takes three parts out of the issue and files them as new issues: the Alertmanager silence match with the critical-alert trigger, the golden-signal and capacity facts, and the toil facts. The remaining groups fit the 64000-token budget of a step. The proposal does not raise the budget. (proposed)
- Chosen: Split the plan. The plan check keeps the budget of a step, and each remaining group fits it.
- Rejected: Raise the budget of the step. It changes a limit of the plan check for one item and hides the size of the group.
- Where do the incident trigger thresholds live?: In the settings of the review run,
roadmap.project_review.incident_triggers, with the owner values of 2026-11-11 as the defaults: a burn rate of 14.4 or more for 1 hour or more with at least 20 events; 50 % or more of the budget used; a critical alert or NodeNotReady for 30 minutes or more; and a revert commit onmain. The review reads each threshold from the settings and keeps no second copy.k8s/README.mdkeeps its 14.4 value only until the settings hold it, and the guideline keeps the triggers as settings of the job that opens the incident. (best practice) [sources: k8s/README.md:178, docs/guidelines/sre.md:90, docs/guidelines/production-readiness.md:65]- Chosen: Settings of the review run.
k8s/README.md:178anddocs/guidelines/sre.md:90record that the trigger values move into the settings of the incident job, anddocs/guidelines/production-readiness.md:65names those settings as the proof of the trigger row. - Rejected: Fact catalog. The catalog schema requires a reader, a query and a unit for each fact, so a policy threshold is not a fact, and the project records the move of the trigger value into the settings.
- Rejected: The
k8s/README.mdvalue.k8s/README.md:178says the value stays there only until the settings of the incident job hold it, so it is a temporary copy.
- Chosen: Settings of the review run.
- Which series feed the budget and the burn rate of the review window?:
query_rangeover the review window, from the SLI query of the Sloth spec. The query uses{repo}and the review window in place of{{.window}}. The review reads theslo:*rules only where their fixed windows match the review window. (best practice) [sources: src/devops_cli/prometheus/client.py:120, docs/guidelines/sre.md:59, k8s/devops/monitoring/slos/runner-jobs-duration.yaml:25]- Chosen:
query_rangeover the review window. It gives the values of a window of any length, and the low-sample rule counts the same events. - Rejected: The
slo:*recording rules. Sloth writes fixed windows, anddocs/DESIGN.mdC12 (c) names only the 1 h and 6 h series.
- Chosen:
- How does the review compute the budget and the burn rate?: The review computes the events and the bad events from the SLI query of the Sloth spec: the valid events are the denominator and the good events are the numerator, so the error ratio is the bad events over the valid events. Budget = (1 - objective) x events. Budget used = bad events / budget. Burn = error ratio / (1 - objective). An SLO with fewer than 20 events in the long window says
low sample. [sources: docs/guidelines/sre.md:55, docs/guidelines/sre.md:59, docs/guidelines/sre.md:70, k8s/devops/monitoring/slos/runner-jobs-duration.yaml:25] - When does an SLO row say met, at risk or breached?: Breached when the budget left is below 0 %. At risk when the budget left is 0 to 25 %. Met when the budget left is above 25 %. (best practice) [sources: docs/DESIGN.md:228]
- Chosen: Budget left against the C12 (a) thresholds.
docs/DESIGN.mdC12 (a) gives these thresholds for the SLO tiles, and the table shows the budget left. - Rejected: The burn rate against 1. A burn rate of 1 exhausts the budget only at the end of the SLO period.
- Rejected: The SLI against the objective. It gives met and breached only, with no at-risk word before the budget is spent.
- Chosen: Budget left against the C12 (a) thresholds.
- How does the review decide that a critical alert or NodeNotReady is an incident trigger?: From the
ALERTSseries in thequery_rangeresponse of the review window: the review sums the time that each critical or NodeNotReady series holds the value 1, and the timeline starts at the first sample with the value 1. An alert that an active silence matches is not a trigger, and theALERTSseries does not know the silences, so the match comes from the Alertmanager API. That match and the trigger move to their own issue with the Alertmanager address. (best practice) [sources: docs/guidelines/sre.md:93, src/devops_cli/roadmap/project_review/catalog.yaml:448, src/devops_cli/roadmap/project_review/catalog.yaml:483, openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/design.md:10]- Chosen:
ALERTSfor the firing time and the Alertmanager API for the silences. The series gives the firing time of the window, and the guideline says the alert state comes from the Alertmanager API because the series does not know the silences. - Rejected: The
ALERTSseries only. It counts an alert that an active silence matches as a trigger, whichdocs/guidelines/sre.md:93forbids.
- Chosen:
- Which events make the UTC timeline of the incident section?: The
ALERTSstate changes, the releases, thek8s/commits and the ERROR lines of the review window, in UTC order. The section holds the summary, the impact with the SLI and the budget used, the root cause and the action items, in the T10 tables ofdocs/DESIGN.md. (best practice) [sources: docs/DESIGN.md:246, docs/guidelines/sre.md:176, docs/guidelines/sre.md:177]- Chosen:
ALERTSchanges, releases, commits and ERROR lines. Each source marks one step of the incident, and a reader follows them in one UTC order. - Rejected: The
ALERTSstate changes only. It leaves out the releases and the commits that a reader needs to find the cause.
- Chosen:
- How does the review compute the 7-day stage SLI?: From the
query_rangeresponse of the review window, with the good and the total counts of the stage window. A recorded response gives the SLI 0.372. (best practice) [sources: src/devops_cli/prometheus/client.py:120, openspec/specs/roadmap-project-review/spec.md:138, src/devops_cli/roadmap/project_review/catalog.yaml:252]- Chosen:
query_rangeover the review window. It gives the good and the total counts of the 7-day window, and a fixture checks the 0.372 value offline. - Rejected: The
slo:*recording rules. Their fixed windows do not give the 7-day stage window that the issue names.
- Chosen:
- Are feat(roadmap): read project review facts through a catalog #4692 and feat(monitoring): define the Service SLOs in a Sloth spec #4709 still needed before this issue?: No. Both are delivered: the fact catalog is
src/devops_cli/roadmap/project_review/catalog.yaml, and the four Sloth specs are ink8s/devops/monitoring/slos/and rendered intok8s/devops/monitoring/prometheus-rules-values.yaml. The issue depends on no open item. [sources: src/devops_cli/roadmap/project_review/catalog.yaml:1, k8s/devops/monitoring/slos/runner-jobs-duration.yaml:1, k8s/devops/monitoring/prometheus-rules-values.yaml:537]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It is a new reporting feature that depends on two other items and is not a critical fix.It adds SRE performance and incident data to the project review, which helps track service health.The body estimates 200 to 300 lines with tests and 1 to 2 days elapsed.Both items work in the roadmap subsystem, but 4693 files brain insights through intake while the candidate adds SLO and incident data to the project review.dan-petty commentedon Nov 13, 2026
The SRE service spec (#5445,
docs/SRE.md, Toil and automation) counts the hand steps of the owner each week:devops roadmap inbox),No metric counts them on 2026-11-13. Please let the toil facts of this item use these 3 counts, and show the hours of each week as
docs/DESIGN.mdC12 (e) says.dan-petty commentedon Nov 13, 2026
Scope from the spec split (2026-11-13)
The SRE spec loses its measured values (owner directions of 2026-11-13), so this section of the project review gives them:
Read the trigger values from the settings of the incident job of #5477, not as values of the fact catalog. The proposed solution of this item puts the trigger rules in the catalog. Then the triggers live in two places: the catalog and the settings of #5477. With one source, a change of a trigger changes the review and the incident job together. The defaults of these settings are the triggers of the SRE guideline (
docs/guidelines/sre.mdafter #5538).devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches and repository facts turn up Sloth (and Pyrra) as SLO tooling, but both only generate Prometheus recording and alerting rules over fixed windows; none computes events, budget and burn rate for an arbitrary past review window. Sloth does cover the SLO spec and the fixed-window
slo:*series the review reads, so it covers part of the need, while the SLO math, low-sample rule, table/status words and incident/postmortem sections stay in the review code.The repository already uses this tool.
Tool: slok/sloth (https://github.com/slok/sloth)
Covers:
k8s/monitoring/slos/slo:*series the review can read where they match the windowLacks:
ALERTS, releases, commits and ERROR lines, root cause and action itemsTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at cd3e0f9 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/project_review/facts.py.devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
5 remaining items
devops-cli-service commentedon Nov 25, 2026
Owner question: The inputs of the step of the task group "Add the Alertmanager address and the incident trigger settings" hold 67339 tokens, over the budget of 64000 tokens, also after the model split the groups once. Split the group or raise the budget of the step?
Options
Recommendation: Split the group: the plan check keeps the budget of the step.
Evidence
devops-cli-service commentedon Nov 26, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
feat(roadmap): report SLOs and incidents in project review (#4714)
chore(main): release 0.238.0 (#7615)
devops-cli-service commentedon Nov 28, 2026
Released in v0.238.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.238.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 18:38 UTC