Skip to content

feat(roadmap): report SLOs and incidents in the project review #4714

Done

Description

@dan-petty

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 the slo:* 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 ALERTS changes, 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

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.json holds the burn rate 60 and the SLO row says low 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 sample and 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 main in 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.json has 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 risk and breached, 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 check runs after the trigger settings are added.
  • THEN The command passes and the generated docs/CONFIGURATION.md names roadmap.project_review.incident_triggers with 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_range response 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 ALERTS change, a release, a k8s/ 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 on main. The review reads each threshold from the settings and keeps no second copy. k8s/README.md keeps 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:178 and docs/guidelines/sre.md:90 record that the trigger values move into the settings of the incident job, and docs/guidelines/production-readiness.md:65 names 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.md value. k8s/README.md:178 says the value stays there only until the settings of the incident job hold it, so it is a temporary copy.
  • Which series feed the budget and the burn rate of the review window?: query_range over 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 the slo:* 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_range over 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, and docs/DESIGN.md C12 (c) names only the 1 h and 6 h series.
  • 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.md C12 (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.
  • How does the review decide that a critical alert or NodeNotReady is an incident trigger?: From the ALERTS series in the query_range response 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 the ALERTS series 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: ALERTS for 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 ALERTS series only. It counts an alert that an active silence matches as a trigger, which docs/guidelines/sre.md:93 forbids.
  • Which events make the UTC timeline of the incident section?: The ALERTS state changes, the releases, the k8s/ 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 of docs/DESIGN.md. (best practice) [sources: docs/DESIGN.md:246, docs/guidelines/sre.md:176, docs/guidelines/sre.md:177]
    • Chosen: ALERTS changes, releases, commits and ERROR lines. Each source marks one step of the incident, and a reader follows them in one UTC order.
    • Rejected: The ALERTS state changes only. It leaves out the releases and the commits that a reader needs to find the cause.
  • How does the review compute the 7-day stage SLI?: From the query_range response 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_range over 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.
  • 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 in k8s/devops/monitoring/slos/ and rendered into k8s/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.

Moved to new items

#7349, #7350, #7351

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It is a new reporting feature that depends on two other items and is not a critical fix.
    • Value: Medium. It adds SRE performance and incident data to the project review, which helps track service health.
    • Effort: Medium. The body estimates 200 to 300 lines with tests and 1 to 2 days elapsed.
    • Related: feat(roadmap): the brain files project insights through intake #4693, which asks for a different change. 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.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    The SRE service spec (#5445, docs/SRE.md, Toil and automation) counts the hand steps of the owner each week:

    • the items that wait for a person (devops roadmap inbox),
    • the hand steps of the runbooks,
    • the commands that a person runs again after a job.

    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.md C12 (e) says.

  6. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    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:

    • Alert facts: the firing series-hours of each alert, the notifications sent, and the active silences. The catalog entries are in the comment of 2026-11-13 on feat(roadmap): read project review facts through a catalog #4692.
    • Incident trigger inputs: for each trigger, the value that the trigger compares, such as the burn rate and the event count of each window.

    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.md after #5538).

  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    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)

    • License: Apache-2.0
    • Last activity: 2026-10-28
    • Maintained: yes

    Covers:

    • The SLO spec: objective and SLI query that the review reads from k8s/monitoring/slos/
    • Prometheus recording rules and multi-window burn-rate alerts over Sloth's fixed windows, i.e. the slo:* series the review can read where they match the window

    Lacks:

    • Events, bad events, budget, budget used and burn rate for a past window of any length
    • The low-sample rule (fewer than 20 events gives "low sample" and no trigger)
    • The SLO table with the status as a word (met, at risk, breached)
    • The golden-signal, toil and capacity facts and the incident triggers of the catalog
    • The postmortem section: UTC timeline from ALERTS, releases, commits and ERROR lines, root cause and action items

    Tools considered:

    Searches run:

    • library compute error budget burn rate for arbitrary past time window Prometheus, results: 5
    • open source SLO error budget burn rate report tool Prometheus query_range, results: 5
    • pyrra SLO error budget burn rate Prometheus, results: 5
    • sloth SLO generator Prometheus recording rules arbitrary window, results: 5
    • GoogleCloudPlatform slo-generator error budget burn rate, results: 5
    • slo-exporter Prometheus SLO tool, results: 5
    • slok/sloth GitHub Prometheus SLO generator, results: 5
    • python package error budget burn rate SLO calculation library, results: 5
    • openslo slo-toolkit burn rate calculator past window report, results: 5
    • slo-exporter tool error budget burn rate reporting github, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  8. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    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.

  9. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    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.

  10. removed
    status/new
    on Nov 25, 2026
  11. 5 remaining items

  12. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    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

    1. Split the group: A person splits the group and runs the item again.
    2. Raise the budget: A person raises the budget of the step and runs the item again.

    Recommendation: Split the group: the plan check keeps the budget of the step.

    Evidence

  13. removed
    owner/service
    on Nov 25, 2026
  14. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  15. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 28, 2026
  16. added
    status/in-review
    and removed
    status/in-progress
    on Nov 28, 2026
  17. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  18. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 18:38 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions