Repository navigation
Description
Problem or Motivation
- No SLO, error-budget or burn-rate rule exists (grep finds 0 in
k8s/monitoring). - The cluster has 0 PrometheusRule objects and no Prometheus operator. prometheus-server reads
serverFilesfrom the community chart (k8s/monitoring/prometheus-values.yaml). - The project review, the pipeline dashboard (feat(roadmap): a dashboard and alerts for the pipeline #3655) and the SLO panels of the project design spec need one SLO source.
Proposed Solution & Architectural Design
Add k8s/monitoring/slos/*.yaml in the Sloth v0.16.0 prometheus/v1 format. Use the objectives that the owner decided on 2026-11-11, in a 28-day window (it stays inside the 30-day Prometheus retention):
| SLO | SLI | Objective |
|---|---|---|
| Service round success | good rounds / all rounds of devops_cli_service_jobs_total, for each row and repository |
99% |
| Runner Job duration | runner Jobs that end within 3,600 s / all runner Jobs | 90% |
| Gateway request success | gateway requests with no error / all gateway requests | 99.5% |
| Gateway latency | gateway requests that end in under 60 s / all gateway requests | 95% |
- No burn trigger fires with fewer than 20 events in the long window. Put this condition into the alert expressions.
- The implement-delivery SLO is not in this item. It comes after the implement counter fix (fix(roadmap): count each implement outcome once with its repo #4703).
- Pin Sloth v0.16.0 the way the project pins its other CLI tools at that time (refactor(security): tools are found on PATH and not in tools.lock #4362 and chore(tools): remove devops install-tools and tools.lock #4363 remove
tools.lock). - Generate plain rule groups into
k8s/monitoring/slo-rules-values.yaml. The Prometheus Argo CD Application lists that file invalueFiles. Do not generate PrometheusRule objects. - Add a pre-commit and CI check that the file equals a fresh generation, and
promtooltests. - Add runbook rows to
k8s/README.md.
Measured for 7 days to 2026-11-11T14:51:23Z: devops-cli stage 58.3 successes and 98.5 errors (0.372); runner Jobs n = 94, p50 1,000.5 s, p90 2,979.2 s; gateway 38 failed of 74,151 requests, p95 35.9 s. The devops-cli stage row breaches its objective at once. That is a true signal, not a defect of the SLO.
Target Subsystem
Monitoring (k8s/monitoring/), with the pre-commit and CI checks.
Existing Tool Considered
Sloth v0.16.0 (Apache-2.0) generates the multi-window, multi-burn-rate rules from one spec, so no SLO rule is written by hand. promtool (in use in CI) checks and tests the rules. Pyrra v0.10.2 (Apache-2.0) also generates the rules, but it adds a running service and a UI that the project does not need. Cost (estimate): spec and values files plus one generation check, about 0.33-0.50 USD on the DeepSeek implement path and 1-2 days elapsed.
Acceptance Criteria
promtool check rulesandpromtool test rulespass, with one fixture for each SLO.- After the Argo CD sync,
slo:sli_error:ratio_rate1hreturns series for each SLO within 10 min. - The check fails when the spec changes and the file is not generated again.
- A fixture with fewer than 20 events in the long window fires no burn alert.
Dependencies
None. The owner set the objectives on 2026-11-11.
Source: #4679
Alternatives check of 2026-11-23: 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 v0.16.0, a maintained one-shot CLI that turns one prometheus/v1 spec into SLI recording rules and multi-window, multi-burn-rate page and ticket alerts. The issue already names it; the repository generator adds the 20-event guard and checks.
Covers:
- One spec becomes SLI recording rules
- Multi-window, multi-burn-rate page and ticket alerts
- Metadata rules for error budget and objective
Lacks:
- No minimum 20-event guard in the long window
- No regeneration-equality check
- No promtool fixtures or Argo CD wiring
Proposed design
Problem statement
No SLO, error-budget or burn-rate rule exists in k8s/monitoring, and the cluster runs no Prometheus operator. The project review, the pipeline dashboard (#3655) and the SLO panels of the project design spec need one SLO source. This change adds four Sloth specs in the 28-day window, generates one rule file from them, checks that the file is the output of its generator, and tests the rules with promtool. It also moves the service dashboards to the same window and moves each objective out of k8s/README.md into the spec.
Acceptance criteria
Requirement: One Sloth spec for each SLO
The change SHALL add one Sloth prometheus/v1 spec under k8s/monitoring/slos/ for each of the four SLOs.
Scenario: Four specs hold the four SLOs
- WHEN A test reads each spec under
k8s/monitoring/slos/. - THEN It finds four specs, each with a 28-day window and the objective of its SLO.
Requirement: Spec names a catalog service
Each SLO spec MUST name a service value that k8s/catalog.toml holds.
Scenario: An unknown service name fails the test
- WHEN A test compares the
servicevalue of each spec with the service names ofk8s/catalog.toml. - THEN The test passes only when each name is in the catalog.
Requirement: Runner Job caveat in the spec
The spec of the Runner Job SLO SHALL state in its description that only the runner Jobs that end count.
Scenario: The description names the Jobs that end
- WHEN A test reads the
descriptionfield of the Runner Job spec. - THEN The text states that a Job with no end is not in the SLI.
Requirement: Pinned Sloth binary
The change MUST pin Sloth v0.16.0 in src/devops_cli/tools_lock/tools.lock with a release URL and a sha256 for each platform.
Scenario: The lock holds the Sloth pin
- WHEN A test reads
[binary.sloth]insrc/devops_cli/tools_lock/tools.lock. - THEN The version is 0.16.0 and every platform entry holds a URL and a sha256.
Requirement: Rules file equals a fresh generation
The check SHALL fail when k8s/monitoring/slo-rules-values.yaml differs from a fresh run of the repository generator that runs sloth generate on the specs and applies the minimum-event guard.
Scenario: A changed spec with no new generation fails
- WHEN A test runs the generator with the pinned binary and compares its output with the committed file.
- THEN The test passes only when the two files are equal.
Requirement: Prometheus loads the generated rules
The Prometheus release MUST load the generated rules file from its chart values.
Scenario: The file is named in rule_files and in valueFiles
- WHEN A test reads
k8s/monitoring/prometheus-values.yaml,k8s/argocd/apps/prometheus.yamlandHELM_RELEASES_BY_STACKinsrc/devops_cli/commands/k8s/stack_lifecycle.py. - THEN
/etc/config/slo_rules.ymlis inrule_files, and the values file is invalueFilesand in thevalueslist of the prometheus release.
Requirement: A recording rule for each SLO
The generated file SHALL hold the slo:sli_error:ratio_rate1h recording rule of each of the four SLOs.
Scenario: Four 1-hour error-ratio rules
- WHEN A test parses the groups of the generated file.
- THEN Four rules named
slo:sli_error:ratio_rate1hexist, one for each SLO.
Requirement: promtool checks and tests the rules
promtool check rules and promtool test rules MUST pass on the generated file, with one fixture for each SLO.
Scenario: Each SLO has a fixture
- WHEN A test runs
promtool check ruleson the file andpromtool test ruleson the fixtures. - THEN Both commands exit 0 and the fixtures cover each of the four SLOs.
Requirement: No alert under 20 events
Each burn-rate alert SHALL require at least 20 events in its long window.
Scenario: A quiet row fires no page alert
- WHEN A fixture sends fewer than 20 events in the long window of a row, with an error ratio above the page threshold.
- THEN No page alert fires for that row.
Requirement: Ticket windows see a low-traffic row
A row with fewer than 20 runs in 1 hour MUST fire only through the 1-day and 3-day ticket windows.
Scenario: The stage row of devops-cli
- WHEN A fixture sends at most 5 runs in 1 hour at a 7-day burn rate of 70x.
- THEN The 1-day and 3-day ticket alerts fire and the page alert stays quiet.
Requirement: Service dashboards use 28 days
The service dashboards SHALL use slo_window_days = 28 and the 13.44x and 5.6x burn-rate lines.
Scenario: The table and the built dashboards
- WHEN A test reads
k8s/monitoring/dashboards/services.tomland the builtdevops-sre-service.jsonanddevops-roadmap-service.json. - THEN The window is 28 days, and no SLO tile or burn-rate panel of the two dashboards holds the 14.4x or 6x line.
Requirement: README names the spec, not the objective
The four SLO rows of the section "Service levels" of k8s/README.md SHALL name the spec of each SLO and hold no objective or window.
Scenario: One place for each objective
- WHEN A test reads the section "Service levels" of
k8s/README.md. - THEN Each of the four rows names its spec file and holds no objective percentage or window, and the SLO 5 row keeps its objective until its own spec.
Requirement: Runbook row for each SLO alert
k8s/README.md SHALL give a runbook row for each generated SLO alert.
Scenario: Each alert has a row
- WHEN A test reads the Alerting table of
k8s/README.md. - THEN Each alert name of the generated file has a row.
Existing Tool Considered
Sloth v0.16.0 (Apache-2.0) is the tool: one prometheus/v1 spec becomes the SLO recording rules and the multi-window, multi-burn-rate alerts, and it runs as a one-shot CLI, so no running service or UI is added. Its repository page, fetched 2026-11-15, states that Sloth is actively maintained, shows its latest commit on 2026-10-28, and shows the tree preparing the v0.16.0 release; the alternatives check of 2026-11-14 gives the verdict in-use. Sloth lacks the minimum of 20 events in the long window, so the repository generator that wraps sloth generate adds that guard to the generated alert expressions. Sloth also gives no regeneration-equality check, no promtool fixtures, no runbook rows and no Argo CD wiring, so the repository supplies them. Pyrra v0.10.2 stays out: it adds a running service and a UI that the project does not need. Cost (estimate): the spec and values files, the generator with its guard, and the checks, about 0.33-0.50 USD on the DeepSeek implement path and 1-2 days elapsed.
Key questions
- Which open, maintained tool generates the SLO recording rules and the burn-rate alerts?: Sloth v0.16.0 (Apache-2.0) generates the rules from one spec file. The repository page, fetched 2026-11-15, states that Sloth is actively maintained, its latest commit is 2026-10-28, and its tree prepares the v0.16.0 release; the alternatives check of 2026-11-14 gives the verdict in-use, and the item already names the tool. Pyrra adds a running service and a UI that the project does not need. (best practice) [sources: https://github.com/slok/sloth]
- Chosen: Sloth v0.16.0. It turns one spec into the recording rules and the multi-window burn-rate alerts, and it runs as a one-shot CLI.
- Rejected: Pyrra v0.10.2. It adds a running service and a UI that the project does not need.
- Rejected: Hand-written rules. Each SLO would need its rules written and kept by hand, so the spec would not be the only source.
- How does the project pin the Sloth binary?: The change adds
[binary.sloth]at version 0.16.0 tosrc/devops_cli/tools_lock/tools.lock, with the per-platform release URL and sha256, as[binary.promtool]sits there at line 544. The CI and pre-commit check install it withuv run devops install-tools --tool sloth --only-missing, as the promtool step ofci.ymldoes, so the check runs the same pinned binary everywhere.tools.lockis present at this commit and its header says it holds every tool thatdevops install-toolsinstalls; the body's premise that refactor(security): tools are found on PATH and not in tools.lock #4362 and chore(tools): remove devops install-tools and tools.lock #4363 remove it has no copy in the tree. (best practice) [sources: src/devops_cli/tools_lock/tools.lock:1, src/devops_cli/tools_lock/tools.lock:544, .github/workflows/ci.yml:180, docs/CLUSTER.md:62]- Chosen: Add
[binary.sloth]tosrc/devops_cli/tools_lock/tools.lock. The lock is the pin thatdevops install-toolsreads, it already holds promtool at line 544, and the devcontainer and CI both install its tools. - Rejected: Pin only in
.devcontainer/Dockerfileby URL and sha256. It gives CI and the pre-commit hook no installer entry, so the check cannot fetch the pinned binary. - Rejected: Pin a container image by digest. It adds an image pull to each check, and no other CLI tool of the repository runs that way.
- Chosen: Add
- Which window and which objectives do the four SLOs use?: Each SLO uses the 28-day window and the objective of the SLO table of
k8s/README.md: 99% for the Service round success, 90% for the Runner Job duration, 99.5% for the gateway request success and 95% for the gateway latency. The window stays inside the 30-day Prometheus retention. [sources: k8s/README.md:546, k8s/README.md:548-554, docs/guidelines/sre.md:52, k8s/monitoring/prometheus-values.yaml:11] - Where does the generated rule file live, and how does Prometheus load it?: The generated file is
k8s/monitoring/slo-rules-values.yaml, a Helm values file with the groups underserverFiles.slo_rules.yml. Therule_fileslist ofk8s/monitoring/prometheus-values.yamladds/etc/config/slo_rules.yml. The Applicationprometheuslists the values file invalueFiles, and the prometheus entry ofHELM_RELEASES_BY_STACKnames it in itsvalueslist. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:193-202, k8s/argocd/apps/prometheus.yaml:15-17, src/devops_cli/commands/k8s/stack_lifecycle.py:187-195]- Chosen: A
serverFileskey in a third values file. The chart writes eachserverFileskey to the ConfigMap that the server mounts, and the file stays the output of one generator. - Rejected: PrometheusRule objects. No Prometheus operator reconciles them, and the server reads
serverFilesfrom the community chart. - Rejected: Hand-copied rule groups. The spec would not be the only source, and the generation check would have nothing to compare.
- Chosen: A
- Does the generated values file set
serverFiles.prometheus.yml.rule_filesitself?: No. The list stays ink8s/monitoring/prometheus-values.yaml, which adds/etc/config/slo_rules.yml. A values file that sets the list replaces it, and the 4 chart defaults and the product rule file would leave the server. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:196-202, k8s/devops/monitoring/prometheus-rules-values.yaml:6]- Chosen: Add the file name to
rule_filesin the environment values. One list keeps the chart defaults, the product rules and the SLO rules. - Rejected: Set
rule_filesin the generated values file. Helm replaces a list, so the 4 chart defaults and the product rule file would drop.
- Chosen: Add the file name to
- How does the low-sample rule enter the generated alerts?: Sloth generates no minimum-event condition. The repository generator that runs
sloth generateappends one condition on the SLO's event count over the alert's long window (>= 20) to each burn-rate alert expression, and the equality check compares the committed file with that generator's output, not with baresloth generate. A fixture proves it for a quiet row and for the stage row of devops-cli. (best practice) [sources: docs/guidelines/sre.md:54, docs/guidelines/sre.md:71, k8s/README.md:560]- Chosen: Add a condition on the event count of the long window in the repository generator. It keeps the owner rule of 20 events and the burn-rate lines of the SLO, and the generated file stays reproducible.
- Rejected: Lower the burn-rate threshold. It changes the page line, and the owner set the line and the 20 events apart.
- Rejected: Add no guard. A quiet row would page on one error, against the owner rule.
- Which window and which burn-rate lines do the service dashboards use?: The service dashboards use
slo_window_days = 28, with the 13.44x page line and the 5.6x ticket line thatdocs/DESIGN.mdC12(c) gives for 28 days. The line is computed from the window (share * window hours / hours), so the 30-day values 14.4x and 6x go with the window change. (best practice) [sources: k8s/monitoring/dashboards/services.toml:20, k8s/monitoring/dashboards/services.toml:31, docs/DESIGN.md:230, src/devops_cli/grafana/service_dashboard.py:465]- Chosen: 28 days with 13.44x and 5.6x. The dashboards then show the window and the lines of the Sloth specs.
- Rejected: Keep 30 days with 14.4x and 6x. The dashboards would not match the SLO window, and the lines are the 30-day values.
- Does the SLO table of
k8s/README.mdkeep the objectives after this change?: No for the four SLOs of this change: their rows name the spec of each SLO and hold no objective or window, so the spec is the only place of each. The SLO 5 row (ingress) keeps its objective, because it is not one of the four SLOs of this item and no spec holds it yet. The runbook rows of the alerts stay ink8s/README.md. (best practice) [sources: k8s/README.md:546, k8s/README.md:548-556, openspec/changes/archive/2026-11-13-5538-split-the-sre-spec/tasks.md:36]- Chosen: Move the four objectives to the specs and name the spec from each row. One copy of each objective and window, and the table points to it.
- Rejected: Keep the objectives in both places. Two copies drift, and no check compares them.
- Rejected: Move the SLO 5 objective too. This item adds no ingress spec, so SLO 5 would lose its only target.
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.(monitoring)scope of the title gives the scope.The project has zero SLOs and multiple items reference needing one, but no outage or regression blocks this work.It gives the project its first SLO source, which the review, dashboard, and design spec all depend on.The body estimates 1-2 days for spec files, generation checks, and runbook rows.Both add Prometheus rules for the roadmap Service in k8s/monitoring, but #2472 delivers specific condition alerts while this candidate delivers SLO objectives with multi-window burn-rate rules.dan-petty commentedon Nov 13, 2026
The SRE service spec (#5445,
docs/SRE.md) uses the 28-day window of this Sloth spec for each SLO.k8s/monitoring/dashboards/services.tomlstill useslo_window_days = 30and the 30-day page lines 14.4x and 6x.docs/DESIGN.mdC12 (c) now gives the page lines of both windows: 13.44x and 5.6x for 28 days. Please set the window of the service dashboards to 28 days in this change.stageof devops-cli had at most 5 runs in an hour in 7 days, at a 7-day burn rate of 70x. Only the 1 d and 3 d ticket windows can see such a row. Please keep a test for this case.dan-petty commentedon Nov 13, 2026
Scope from the spec split (2026-11-13)
The split of the SRE spec (#5538) adds
k8s/catalog.tomland a catalog generator (#5535). For the Sloth specs of this item:servicename of itsk8s/catalog.tomlentry. The catalog generator joins the SLI, the objective and the window by this name, and fails on a name that the catalog does not hold.k8s/README.md. docs(monitoring): split the SRE spec into a guideline and decisions #5538 adds these rows until this item merges. After the merge, the spec is the only place of each objective and window.devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches found Sloth, the Apache-2.0 SLO generator that the issue itself already names: it turns one SLO spec into Prometheus recording rules and multi-window, multi-burn-rate alerts, with no extra running service (Pyrra, the alternative the issue rejects, adds a service and UI). No ADR in force rejects it, and its generated rule groups are what the issue's promtool checks and generation-equality check would validate.
The repository already uses this tool.
Tool: slok/sloth (https://github.com/slok/sloth)
Covers:
Lacks:
Tools 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
Status set to Ready at cd3e0f9 (see proposed design in issue body).
85 remaining items
devops-cli-service commentedon Nov 25, 2026
The runner Job devops-cli-implement-devops-cli-4709-2e82af ended: succeeded.
Image digest: sha256:50fb50c12971cbc9c7be8061af3dfefbac50c35e1262851e33ab0623a9cf84d8
The last lines of its log:
(no log: the Job has no pod)
Failure class:
ci_infra.Action taken: none.
Action left:
retry: run the item again.The Job left this item without a result. The item is Blocked. When a retry can fix the class of the stop, the Service starts a new Job in the next round. The limit is
roadmap.implement.continuations_per_item, and the comment of that round says so. If no continuation is left, fix the cause. Then commentimplement: retry. A new runner image also clears the stop. This holds only if a retry can fix the class of the stop. The limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemmust also allow it.feat(monitoring): define the Service SLOs in a Sloth spec (#4709)
docs(openspec): archive the change (#4709)
fix(monitoring): match implement runner jobs and zero-error ratios (#…
devops-cli-service commentedon Nov 25, 2026
Released in v0.214.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.214.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 03:35 UTC