Repository navigation
Description
Split from #4562.
The issue asks for a recording rule for pending work. The move of the roadmap rows to their own pods removes the queue, and a sweep on a cluster schedule replaces the poll and the lanes (#4517). The in-flight observability and caching study does not yet name the series that shows pending work, so a rule written now would record a series that the move deletes. This part waits on that study, so it is deferred from the shared recording rules. Acceptance criteria: - A recording rule named in the level:metric:operations form records pending work from the series that the study names. - The rule selects the row pods with job=~"roadmap-service|roadmap-.+" and keeps job with a without clause. - A promtool test proves that the rule returns the pending work value, and no case evaluates more than 1,000 rounds. - The record name and its input metric are added to SERVED_SERIES in tests/prometheus/test_k8s_monitoring_alerting.py.
Proposed design
Problem statement
The roadmap Service moves its row work into roadmap-<row> pods, and a sweep on a cluster schedule replaces the poll and the lanes (#4517). The move removes the row queue, so the gauge devops_cli_roadmap_row_queue_items stops, and a recording rule for roadmap pending work must read the series that the in-flight observability and caching study names. The study does not name that series yet, so the rule waits on it. Once it lands, one recording rule in the roadmap-service-recording group, one promtool case and the SERVED_SERIES entries record the pending work, and a person reads the value in the Roadmap Service widget of the cluster start page, which is updated in dan-petty/homelab after the merge.
Acceptance criteria
Requirement: Pending work recording rule
The roadmap-service-recording group of k8s/devops/monitoring/prometheus-rules-values.yaml SHALL hold the recording rule devops_cli:roadmap_pending_work:sum, named in the level:metric:operations form, whose expression records roadmap pending work from the series that the study names.
Scenario: promtool accepts the new recording rule
- WHEN
promtool check rulesruns over theroadmap-service-recordinggroup written to a rule file - THEN promtool prints
SUCCESSand exits 0
Requirement: Pending work value
The promtool case of the new rule MUST prove that the recorded series holds the pending work value of the input series.
Scenario: The case expects the pending work value
- WHEN
promtool test rules tests/fixtures/prometheus_rules/roadmap_service_recording_tests.yamlruns in a directory that holds the group written toroadmap-service-recording.rules.yaml - THEN promtool prints
SUCCESSand the expected sample ofdevops_cli:roadmap_pending_work:sumholds the pending work value of the sample series
Requirement: Job selector and label removed
The recording rule MUST select the row pods with job=~"roadmap-service|roadmap-.+" and aggregate with a without (job) clause, so the recorded series carries no job label.
Scenario: Two row pods record one series
- WHEN
promtool test rules tests/fixtures/prometheus_rules/roadmap_service_recording_tests.yamlruns the new case with a sample ofjob="roadmap-service"and a sample ofjob="roadmap-intake" - THEN promtool prints
SUCCESSand the expecteddevops_cli:roadmap_pending_work:sumholds one sample with nojoblabel
Requirement: Round budget
Each case of the new rule in tests/fixtures/prometheus_rules/roadmap_service_recording_tests.yaml MUST evaluate no more than 1,000 rounds.
Scenario: The new case stays within the round budget
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k no_promtool_case_evaluates_more_rounds_than_the_budgetruns - THEN the test passes and reports no case of
tests/fixtures/prometheus_rules/roadmap_service_recording_tests.yamlaboveMAX_PROMTOOL_ROUNDS
Requirement: Served series
SERVED_SERIES in tests/prometheus/test_k8s_monitoring_alerting.py SHALL hold the record name devops_cli:roadmap_pending_work:sum and the input metric of the new rule.
Scenario: The served-series list holds the new names
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k test_the_pending_work_series_are_servedruns - THEN the test passes and
SERVED_SERIESholdsdevops_cli:roadmap_pending_work:sumand the input metric of the rule
Requirement: Pending a person after the merge
After the merge, a person SHALL add one metric for the recorded pending work to the Roadmap Service widget in k8s/startpage/config/services.yaml of dan-petty/homelab.
Scenario: The start page shows the pending work
- WHEN the rule is deployed and a person opens the start page at the
starthost - THEN the
Roadmap Servicewidget shows the pending work value ofdevops_cli:roadmap_pending_work:sum
Existing Tool Considered
No alternatives check has run on this item. Prometheus, the open and maintained monitoring server (Apache-2.0), covers the need with a recording rule, and its promtool check rules and promtool test rules validate and test that rule. The repository already loads the product rule file k8s/devops/monitoring/prometheus-rules-values.yaml and runs the promtool of the devtools image over it (tests/prometheus/test_k8s_monitoring_alerting.py:438, docs/CLUSTER.md:192, .github/workflows/ci.yml:194). The tool lacks nothing here: the change builds no tool, so it has no build cost, and it adds one rule, one promtool case, the SERVED_SERIES entries and one small pin test.
Key questions
- Which series holds roadmap pending work after the queue move?: None today.
devops_cli_roadmap_row_queue_itemsis the gauge that the rows send from the listing that their round reads (docs/TELEMETRY.md:175,src/devops_cli/telemetry/instruments.py:625,src/devops_cli/roadmap/run.py:416), and the move removes the queue that it counts. The in-flight observability and caching study must name the replacement series before the rule is written. [sources: docs/TELEMETRY.md:175, src/devops_cli/telemetry/instruments.py:625, src/devops_cli/roadmap/run.py:416] - Which values file and which group hold a new roadmap recording rule?: The
roadmap-service-recordinggroup ofk8s/devops/monitoring/prometheus-rules-values.yaml, underserverFiles.devops_cli_alerting_rules.yml. It already records the shared row work series of the Service (feat(monitoring): record the shared roadmap Service selectors #4562), and it has its own promtool case file,tests/fixtures/prometheus_rules/roadmap_service_recording_tests.yaml, inROADMAP_SERVICE_GROUP_TESTS. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:29, tests/prometheus/test_k8s_monitoring_alerting.py:121, tests/prometheus/test_k8s_monitoring_alerting.py:136]- Chosen: The
roadmap-service-recordinggroup of the product rule file. It already holds the recorded row work series of the Service and has a promtool case file of its own. - Rejected: The
roadmap-servicegroup. It holds the alert rules of the Service, and the recorded series of feat(monitoring): record the shared roadmap Service selectors #4562 left it forroadmap-service-recording. - Rejected: A new group with a new case file. It adds a group and a file for one rule, while the recorded series of the Service stay in
roadmap-service-recording.
- Chosen: The
- Which form does the name of the recording rule take?:
level:metric:operations:devops_cliis the level (the project prefix of the earlier recording ruledevops_cli:ai_reference_price_usd_per_token),roadmap_pending_workis the recorded quantity andsumis the operation. (best practice) [sources: openspec/specs/product-monitoring-content/spec.md:41, k8s/devops/monitoring/prometheus-rules-values.yaml:26, openspec/changes/archive/2026-10-24-1672-local-savings-reference-prices/specs/ai-spend-pricing/spec.md:17]- Chosen:
level:metric:operations. The body requires this form, the living spec requires exactly two colons and no empty part, and the project's earlier recording rule used thedevops_clilevel with a colon-separated name. - Rejected: A free-form metric name. It states no level and no operation, so a second rule over the same quantity needs a second name with no pattern.
- Chosen:
- Where does a person read roadmap pending work?: In the
Roadmap Servicewidget of the cluster start page, configured ink8s/startpage/config/services.yamlof dan-petty/homelab. The widget shows the budget used, the failed jobs and the suspended rows from recorded series and has room for one more value; the owner's reply on this issue says that repository adds the new metric after this rule records it, so this item does not change the widget and the edit is the step after the merge. (best practice) [sources: docs/adr/0039-homepage-is-the-cluster-start-page.md:33]- Chosen: The
Roadmap Servicewidget of the start page. The widget already reads recorded series of the Service, it has room for one more value, and the start page of the environment tree lives in dan-petty/homelab. - Rejected: A new Grafana panel. The widget shows the recorded series of the Service to a person with no dashboard, and the widget has room for the value.
- Chosen: The
- Which existing tests fail when the recording group holds one more recording rule?: None fail. The group already holds three recording rules and is in
ROADMAP_SERVICE_GROUP_TESTSandRULE_GROUP_TESTS(tests/prometheus/test_k8s_monitoring_alerting.py:134,:160). The tests that touch the product rules aretest_promtool_accepts_every_alert_rule, which runspromtool check rulesover each rule file (:438), andtest_no_promtool_case_evaluates_more_rounds_than_the_budget, which reads only thealert_rule_testandpromql_expr_testcases (:452). Neither readsrule["alert"]over every rule, so the earlier plan'stest_the_promtool_files_of_a_group_test_every_alert_of_the_groupandtest_each_unit_tested_rule_fires_on_a_sample_and_stays_quiet_on_a_normal_seriesare not in the module at this commit and the new rule needs no change to an alert-rule check. [sources: tests/prometheus/test_k8s_monitoring_alerting.py:134, tests/prometheus/test_k8s_monitoring_alerting.py:160, tests/prometheus/test_k8s_monitoring_alerting.py:438, tests/prometheus/test_k8s_monitoring_alerting.py:452] - Which command proves a criterion about the product rule file?:
promtool check rulesfor the rule file andpromtool test rulesfor its case.docs/TESTING.mdrefuses a test that reads a manifest or a config file and namespromtoolas the tool that checks the alert rules;docs/CLUSTER.mdnames the two commands and how to write the group to the file that a case file'srule_filesnames. (best practice) [sources: docs/TESTING.md:61, docs/TESTING.md:68, docs/CLUSTER.md:192, openspec/specs/roadmap-service-alerts/spec.md:14]- Chosen:
promtool check rulesandpromtool test rules. They are the project's validators for these rule files, and the living spec of the Service's alerts names them. - Rejected: A pytest test that reads the values file.
docs/TESTING.mdsays a test that reads a manifest or a config file is no proof, and thetest-treerow refuses a new one.
- Chosen:
- Must
SERVED_SERIEShold the record name and the input metric of the new rule?: Yes. The body requires it, and the living spec requiresSERVED_SERIESto hold each record name of every group and each metric that their rules select (openspec/specs/product-monitoring-content/spec.md:54). The list is source (tests/prometheus/test_k8s_monitoring_alerting.py:196); the check that compared each rule with it is gone from the module at this commit, so the change adds the entries and one small test that pins them, and no test that reads the values file. (best practice) [sources: openspec/specs/product-monitoring-content/spec.md:54, tests/prometheus/test_k8s_monitoring_alerting.py:196, tests/prometheus/test_k8s_monitoring_alerting.py:376]- Chosen: Add the entries and pin them in a test of
SERVED_SERIES. The list stays accurate, the body's criterion has a check, and the test reads source code only. - Rejected: Add the entries only. Nothing would fail when a later rule names an unserved metric, and the body's criterion would have no check.
- Chosen: Add the entries and pin them in a test of
Fit
Fits in one pull request.
Suspected block
The in-flight observability and caching study must name the series that shows roadmap pending work after the queue move.
Dependencies
None.
Activity
devops-cli-service 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 item is deferred until the observability study names the series, so no work can start now.The rule keeps pending work visible after the queue move, but no user sees it directly.The work needs one recording rule, a promtool test and an update to SERVED_SERIES.Both items add recording rules for the roadmap move, but #4562 records the shared Service selectors and the candidate records pending work only.devops-cli-service commentedon Nov 19, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
docs(openspec): plan #4562 Record the shared roadmap Service selectors (
dan-petty commentedon Nov 27, 2026
The start page widget of the Roadmap Service (dan-petty/homelab#339, PR dan-petty/homelab#495) shows the budget used, the failed jobs and the suspended rows from recorded series. It shows no pending work, because no recorded series holds it. When this item records the pending work, add one metric to the widget
Roadmap Serviceink8s/startpage/config/services.yamlof dan-petty/homelab. The widget has room for one more value.devops-cli-service commentedon Nov 28, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence