Repository navigation
Description
Problem or Motivation
41 lines of k8s/monitoring/prometheus-values.yaml select job="roadmap-service", and no recording rule exists (grep -c 'record:' is 0; serverFiles holds only alerting_rules.yml). The move of the roadmap rows into their own pods changes the job and service names of the row series (roadmap-<row>), removes the queue and moves the budget to Valkey. Then each alert, panel and start page widget that reads a raw Service selector breaks, and each must change one by one.
Proposed Solution & Architectural Design
- Add
serverFiles.recording_rules.ymlink8s/monitoring/prometheus-values.yamlwith one rule for each selector that alerts, the dashboard and the start page share: for example the failed rounds of 24 hours, the budget used ratio, the suspended rows and the pending work. - The issue lists each of the 41
job="roadmap-service"lines and marks it "router health" (it stays on the router job) or "row work" (it reads a recorded series). - Rule names follow the
level:metric:operationsform (https://prometheus.io/docs/practices/rules/). - The 6 lane alerts that the sweep item removes get no rule.
- Check the result of the in-flight observability and caching study first, and use its names if it gives any.
Target Subsystem
Kubernetes & Minikube Automation (monitoring: k8s/monitoring/prometheus-values.yaml).
Existing Tool Considered
Prometheus recording rules (configuration of an open tool, no build). Cost: about 150,000 tokens and 2 hours, about 3,000 tokens a month to keep.
Acceptance Criteria
- Each "row work" alert reads a recorded series, and its promtool test passes.
- Rule names follow the
level:metric:operationsform. - The promtool tests stay within the time budget of their check.
Dependencies
None. The start page widgets, the pipeline dashboard alerts (#3655) and the unit alerts of the engine and sweep items read these rules.
Source: #4517
Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: prometheus/prometheus (https://github.com/prometheus/prometheus), Apache-2.0, last activity 2026-11-18, maintained.
Reason: Prometheus recording rules in serverFiles and promtool's check and test commands cover the whole need, and its practice page documents the required level:metric:operations naming, ratio form and without clause.
Covers:
- Recording rules in serverFiles rule groups
- promtool check rules and promtool test rules unit tests
- level:metric:operations names with per and ratio
- without clauses that keep job, repo and row labels
Lacks:
- Project selector list and router health/row work fixture
- Test wiring for SERVED_SERIES and RULE_GROUP_TESTS
- A generator that derives rules from a declared selector list
- k8s/README.md alerting text naming the group
Proposed design
Problem statement
The job="roadmap-service" selector lines of k8s/devops/monitoring/prometheus-rules-values.yaml read a raw Service job, and no recording rule exists. The move of row work to roadmap-<row> pods changes that job name, removes the queue and moves the budget to Valkey, so each alert, dashboard panel and start page widget that reads a raw selector breaks one by one. This change adds a roadmap-service-recording group to the product rule file, moves the row work alerts to the recorded series and keeps the router health selectors on the router job. The pending work selectors wait in #4606.
Acceptance criteria
Requirement: Recording rule group
The monitoring test suite SHALL fail when the product Prometheus values file holds no roadmap-service-recording group with at least one recording rule, or the product-monitoring-content spec does not list that group.
Scenario: The product rule file holds the recording group
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_groupruns. - THEN The command exits 0, and a rule file without the group, a group without a
record, or a spec that omits the group fails the check.
Requirement: Rule name form
The monitoring test suite SHALL fail a recording rule whose name is not the level:metric:operations form.
Scenario: The check parses each rule name
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_nameruns. - THEN The command exits 0, and a
recordvalue without exactly two colons or with an empty or non-identifier part fails the check.
Requirement: Shared selectors
The roadmap-service-recording group SHALL hold one rule for each covered row work selector: the 24-hour failed jobs, the budget used ratio and the suspended rows.
Scenario: The covered selectors have a rule
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_selectorsruns. - THEN The command exits 0, each covered selector has exactly one rule that selects
job=~"roadmap-service|roadmap-.+", and itsrecordname names the selector's metric, with_per_andratiofor the budget ratio.
Requirement: Selector fixture
The change SHALL record each line of the product rule file that holds job="roadmap-service" in a fixture with its text and one class, router health or row work.
Scenario: The fixture lists each selector line
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_fixtureruns. - THEN The command exits 0, and a line of the product rule file that holds
job="roadmap-service"with no fixture entry, or an entry with no single class, fails the check.
Requirement: Row work alerts
Each row work alert that the fixture names SHALL read a recorded series in place of a raw job="roadmap-service" selector.
Scenario: The row work alert expressions are checked
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_alertsruns. - THEN The command exits 0, and a row work alert whose expression holds
job="roadmap-service"or names norecordvalue of theroadmap-service-recordinggroup fails the check.
Requirement: Router health selectors
Each line that the fixture classes router health SHALL stay unchanged in the product rule file.
Scenario: The router health lines are unchanged
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_routerruns. - THEN The command exits 0, and a
router healthentry whose text is absent fromk8s/devops/monitoring/prometheus-rules-values.yamlfails the check.
Requirement: Recording rules are not alerts
The monitoring tests SHALL keep recording rules out of the alert-rule checks, so a recording rule needs no severity and no Alerting table row.
Scenario: The alert rule list names no recording rule
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_not_alertsruns. - THEN The command exits 0, and a
recordvalue that reaches the alert-rule list or the baseline rule set fails the check.
Requirement: Served series
The monitoring test SHALL count each record name and each metric that a recording rule selects as served.
Scenario: A recording rule selects an unknown series
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_servedruns. - THEN The command exits 0, and a record name or a selected metric outside
SERVED_SERIESfails the check.
Requirement: Promtool rule tests
The promtool unit tests of the recording rules and of the changed row work alerts SHALL hold a promql_expr_test case for each recording rule and pass within 1,000 rounds of their group.
Scenario: Promtool test rules runs
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_promtoolruns; the check writes theroadmap-service-recordinggroup to the file that the test'srule_filesnames and runspromtool test ruleson its test file. - THEN The command exits 0, each
recordvalue has apromql_expr_testcase, and no case evaluates more than 1,000 rounds of its group.
Requirement: Monitoring docs
k8s/README.md SHALL name the roadmap-service-recording group and the row work alerts that read the recorded series.
Scenario: The alerting section names the recorded series
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k roadmap_service_recording_docsruns. - THEN The command exits 0, and the
## Alertingsection ofk8s/README.mdnamesroadmap-service-recordingand each row work alert that the fixture names.
Existing Tool Considered
Prometheus (prometheus/prometheus, Apache-2.0, maintained) is in use, as the alternatives block of 2026-11-19 records; that block lists what the tool lacks, so the change adds the project-specific part it names and writes each rule by hand. The written cost is about 150,000 tokens and 2 hours, and about 3,000 tokens a month to keep.
Key questions
- Does Prometheus recording rules and promtool cover the need, or does the change build its own code?: Prometheus covers it, and the repository already uses it: recording rules live in
serverFilesrule groups, and the project installs the pinned promtool and runspromtool check rulesandpromtool test rules. Adopt the tool; build no selector-to-rule generator. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:14, .github/workflows/ci.yml:191, docs/CLUSTER.md:172, https://prometheus.io/docs/practices/rules]- Chosen: Use Prometheus recording rules and promtool. The tool is in use, covers the rule groups and the naming practice, and the project already runs its pinned promtool.
- Rejected: Write a selector-to-rule generator. It adds code to build and keep, and the alternatives block finds no generator that the project needs.
- Rejected: Leave the raw selectors in each consumer. The move changes the job name, so each consumer breaks one by one.
- Where does the recording rule group live?: In
serverFiles.devops_cli_alerting_rules.ymlofk8s/devops/monitoring/prometheus-rules-values.yaml. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:14, openspec/specs/product-monitoring-content/spec.md:23, tests/prometheus/test_k8s_monitoring_alerting.py:298, k8s/monitoring/prometheus-values.yaml:202]- Chosen: Add the group to the product rule file. The product-monitoring-content spec puts every group that selects a
devops_cli_series in that file, and the monitoring tests load it through the mergedserverFiles. - Rejected: Add
serverFiles.recording_rules.ymltok8s/monitoring/prometheus-values.yaml. The environment file may hold no group that selects adevops_cli_series. - Rejected: Add a second
serverFileskey to the product file. The spec says the product file holds onlydevops_cli_alerting_rules.yml. - Rejected: Add a separate PrometheusRule resource. The chart loads its rules from
serverFiles, so a second rule source adds a deployment path.
- Chosen: Add the group to the product rule file. The product-monitoring-content spec puts every group that selects a
- Which selectors get a recording rule?: The shared row work selectors: the 24-hour failed jobs, the budget used ratio and the suspended rows. The pending work selectors wait in feat(monitoring): record roadmap pending work after the queue move #4606, and the six lane alerts get no rule because the sweep removes them. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:60, docs/CLUSTER.md:45, docs/CLUSTER.md:50, k8s/devops/dashboards/devops-cli.json:322]
- Chosen: Record the covered row work selectors only. The move changes the job for row pods, and these three selectors are shared by alerts, the dashboard and the start page.
- Rejected: Record all
job="roadmap-service"lines. The router keeps its job, so its health selectors do not break at the move. - Rejected: Record the six lane alerts. The sweep removes the lane poll and the lanes, so those alerts and their series go.
- Rejected: Record the pending work selectors here. The queue move changes the series, and feat(monitoring): record roadmap pending work after the queue move #4606 holds that part.
- Which job matcher does a row rule use?:
job=~"roadmap-service|roadmap-.+". (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:48]- Chosen: Match the router job and
roadmap-.+. It reads the current router series and the future row pods before and after the move. - Rejected: Match
job="roadmap-service"only. The row pods get another job name, so the rule stops reading them. - Rejected: Match all jobs. It counts workstation and unrelated series.
- Chosen: Match the router job and
- How is the budget used ratio recorded?: One rule divides the sum of
devops_cli_service_budget_spent_requestsby the sum ofdevops_cli_service_budget_limit_requests, aggregates each side withwithout, and names the result..._per_...:ratio. (best practice) [sources: https://prometheus.io/docs/practices/rules, k8s/devops/dashboards/devops-cli.json:322, src/devops_cli/config/constants.py:1822, src/devops_cli/config/constants.py:1823]- Chosen: Record one ratio over the spent requests and the limit. It gives the three consumers one shared series and follows the documented name form.
- Rejected: Average the per-repo ratios. An average of ratios is not a valid measure of the whole budget.
- Rejected: Record each side and divide in the dashboard. The alert and the start page cannot read a Grafana division, so the series would not be shared.
- Which rule name form does the project use?:
level:metric:operations. No project ADR or guideline records a form; the Prometheus practice page, fetched 2026-11-20, defineslevelas the aggregation level and labels,metricas the unchanged metric name, andoperationsas the operations newest first, and it separates a ratio's metrics with_per_and calls the operationratio. (best practice) [sources: https://prometheus.io/docs/practices/rules]- Chosen:
level:metric:operations. The body requires it and the Prometheus practice documents it. - Rejected: Free-form names. They state no aggregation level and no operation.
- Rejected: Underscore-separated names. They hide the three parts that the colons separate.
- Chosen:
- Does the change move each
job="roadmap-service"line to a recorded series?: No. Only the row work selectors move. The router health selectors stay onjob="roadmap-service", because the router keeps that job. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:37, k8s/devops/monitoring/prometheus-rules-values.yaml:48, docs/CLUSTER.md:129]- Chosen: Move the row work selectors only. The router keeps the job, so its own series do not break.
- Rejected: Move all
job="roadmap-service"lines. The router health alerts do not break at the move, and the body keeps them on the router job. - Rejected: Move none. The row work selectors break one by one after the move.
- How does the change tell a row work selector from a router health selector?: A selector is row work when it reads a metric that a row pod sends: jobs, rows, GitHub requests, the budget, model requests or item age. It is router health when it reads the router itself: its identity refusal, its webhook deliveries or its pod series. The budget is row work, because the rows spend it and it moves to Valkey. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:37, k8s/devops/monitoring/prometheus-rules-values.yaml:60, k8s/devops/monitoring/prometheus-rules-values.yaml:73, docs/CLUSTER.md:45, docs/CLUSTER.md:50]
- Chosen: Classify by the source of the metric. The move changes the job only for the pods that send the metric, so the source tells which selector breaks.
- Rejected: Keep the budget alert on the router job. The rows spend the budget and it moves to Valkey, so the router series is not the one that changes.
- Rejected: Move all selectors. The router keeps
job="roadmap-service", so its own series do not break.
- How does the monitoring test suite learn that a recorded series is served?: Add each record name and each metric that a rule selects to
SERVED_SERIES, and add the group toRULE_GROUP_TESTSwith its test file; the promtool test writes the group to the file that the test'srule_filesnames. [sources: tests/prometheus/test_k8s_monitoring_alerting.py:128, tests/prometheus/test_k8s_monitoring_alerting.py:145, tests/prometheus/test_k8s_monitoring_alerting.py:298, tests/prometheus/test_k8s_monitoring_alerting.py:342, tests/prometheus/test_k8s_monitoring_alerting.py:462, tests/prometheus/test_k8s_monitoring_alerting.py:480]
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.It is a dependency for #3655 and other alert items but does not block a release on its own.It makes 41 raw selectors into a few recorded series, so alerts and dashboards stay correct after pod and job name changes.The body estimates about 2 hours and 150,000 tokens of work.Both touch roadmap monitoring in k8s/monitoring/prometheus-values.yaml, but the candidate adds recording rules while #3655 adds the dashboard and alerts that consume them.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 5f75d25 (see proposed design in issue body).
Moved to new items: #4606.
devops-cli-service commentedon Nov 12, 2026
Alternatives check: covers
Reason: Prometheus recording rules and its promtool already do everything the item needs: a recording-rule file, the documented
level:metric:operationsnaming withwithoutaggregation that keeps labels such asjob, andpromtool check rules/promtool test rulesto validate and unit-test the rules in CI. The issue itself names Prometheus recording rules and promtool as the tool the project already uses, so no other tool is needed.Tool: prometheus/prometheus (https://github.com/prometheus/prometheus)
Covers:
serverFilesrule file, loaded through the chart'srule_fileslevel:metric:operationsrule naming, including_per_andratiofor ratioswithoutaggregation that preserves labels such asjob,repoandrowfor consumerspromtool check rulesandpromtool test rulesto validate and unit-test rule expressions and their seriesjob="roadmap-service"selectorLacks:
router health/row workclassification fixture and the README text are not provided by the tool and must be written by handSERVED_SERIESand extends the promtool runner to the recording-rule group is repository code, not a Prometheus featureTools considered:
Searches run:
Sources:
Checked on 2026-11-12. A person decides what this means for the item. The check changes no label and closes no issue.
26 remaining items
docs(openspec): plan #4562 Record the shared roadmap Service selectors
docs(openspec): plan #4562 Record the shared roadmap Service selectors (
devops-cli-service commentedon Nov 24, 2026
The draft pull request #6978 holds the final title and body. In mode
onofroadmap.fix_checks.mode, the watch row marks it ready when its checks pass, and a fix-checks Job repairs a failed check whose name gives the class test, lint or types. In each other case the watch row stops the item: another failed check, a cancelled check, a conflict, a fix-checks Job that ended with no repair, or another mode.Spend: 240 model requests, 30100438 input tokens, 177674 output tokens.
devops-cli-service commentedon Nov 24, 2026
Released in v0.209.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.209.0
devops-cli-service commentedon Nov 24, 2026
Live since 2026-11-24 13:45 UTC