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 rows to their own pods, and a sweep on a cluster schedule replaces the poll and the lanes (#4517). The move removes the queue, so the row queue series stops. The item adds one Prometheus recording rule that shows roadmap pending work from the series that the new design serves, a promtool case for it, and the SERVED_SERIES entries. The in-flight observability and caching study does not yet name that series, so a rule written now would record a series that the move deletes: the item waits on the study.
Acceptance criteria
Requirement: Pending work recording rule
The roadmap-service 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, that records roadmap pending work from the series that the study names.
Scenario: promtool accepts the new recording rule
- WHEN
promtool check rulesruns over theroadmap-servicegroup 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_tests.yamlruns the new case with a sample series of the metric that the study names - 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_tests.yamlruns the new case with a sample ofjob="roadmap-service"and a sample ofjob="roadmap-intake" - THEN promtool prints
SUCCESSand the expected seriesdevops_cli:roadmap_pending_work:sumhas nojoblabel
Requirement: Round budget
The promtool case of the new rule 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_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 check accepts the new rule
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k test_every_alert_rule_selects_only_series_the_stack_servesruns - THEN the test passes and the list of unserved selectors is empty
Requirement: Group tests read alert rules only
Each promtool group test in tests/prometheus/test_k8s_monitoring_alerting.py MUST read only the rules of a group that have an alert key.
Scenario: A group with a recording rule passes its alert coverage tests
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k "promtool_files_of_a_group or fires_on_a_sample"runs with promtool on PATH - THEN both tests pass for the
roadmap-servicegroup that holds the new recording rule
Existing Tool Considered
No alternatives check has run on this item. Prometheus, the open and maintained monitoring server, covers the need with its recording rules, and its promtool checks and tests them. 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:14, docs/CLUSTER.md:187, .github/actions/devtools-commands). The tool lacks nothing here: the change builds no tool and adds one rule, one promtool case and the SERVED_SERIES entries.
Key questions
- Which series shows roadmap pending work after the queue move?: The repository names no series for roadmap pending work after the queue move.
devops_cli_roadmap_row_queue_itemsis the gauge that a row sends today from the listing that its round reads, and the move removes the queue that it counts. The sweep that replaces the poll and the lanes is step 6 of ADR 0021 and is open as feat(roadmap): run the reconcile sweep on a cluster schedule #4574. The observability and caching study must name the replacement series before the rule is written. [sources: docs/TELEMETRY.md:166, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:116] - Which values file holds the new recording rule?: The product rule file
k8s/devops/monitoring/prometheus-rules-values.yaml, underserverFiles.devops_cli_alerting_rules.yml. The product rules moved there in refactor(k8s): split the product dashboards and rules in place #5292, and the alert test module reads it asPRODUCT_RULES_VALUES. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:14, tests/prometheus/test_k8s_monitoring_alerting.py:72, openspec/changes/archive/2026-11-13-5292-split-the-product-dashboards-and-rules/specs/product-monitoring-content/spec.md:22]- Chosen: The product rule file. It holds the
devops_cli_*rules of the roadmap Service, and the test module reads it. - Rejected: The environment rule file
k8s/monitoring/prometheus-values.yaml. It holds the environment's rules, and the product rules left it in refactor(k8s): split the product dashboards and rules in place #5292.
- Chosen: The product rule file. It holds the
- Which rule group holds the new recording rule?: The
roadmap-servicegroup of the product rule file. The rule records the Service's own pending work, the group holds the Service's other rules, and it already has a promtool case file inROADMAP_SERVICE_GROUP_TESTS. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml:31, tests/prometheus/test_k8s_monitoring_alerting.py:109]- Chosen: The
roadmap-servicegroup. The rule records the Service's own pending work, and the group already has a promtool test file and the Service's other rules. - Rejected: A new group with a new test file. It adds a group and a test file for one rule, while the Service's other rules stay in
roadmap-service.
- 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/changes/archive/2026-10-24-1672-local-savings-reference-prices/specs/ai-spend-pricing/spec.md:17, k8s/devops/monitoring/prometheus-rules-values.yaml:1]- Chosen:
level:metric:operations. The body requires this form, 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:
- Which command proves a criterion about the product rule file?:
promtool check rulesfor the rule file andpromtool test rulesfor its case.docs/TESTING.mdrequires a validator command or a live check for a criterion of a config file and refuses a test that reads the file, and the living spec of the group uses these two promtool commands. (best practice) [sources: docs/TESTING.md:68, openspec/specs/roadmap-service-alerts/spec.md:14]- Chosen:
promtool check rulesandpromtool test rules. They are the project's validator commands for these rule files, and the living spec of the group names them. - Rejected: A pytest test that reads the values file.
docs/TESTING.mdsays a test that reads a config file is no proof.
- Chosen:
- Which existing tests fail when a group holds a recording rule?:
test_the_promtool_files_of_a_group_test_every_alert_of_the_groupreadsrule["alert"]for every rule of a group, andtest_each_unit_tested_rule_fires_on_a_sample_and_stays_quiet_on_a_normal_seriesdoes the same. A recording rule has noalertkey, so both raiseKeyErroruntil they read only the rules that have analertkey. The write-rule test filters by alert name in theroadmap-service-activitygroup, which the new rule does not join. [sources: tests/prometheus/test_k8s_monitoring_alerting.py:462, tests/prometheus/test_k8s_monitoring_alerting.py:510, tests/prometheus/test_k8s_monitoring_alerting.py:388] - Must
SERVED_SERIEShold the input metric of the new rule?: Yes._unservedchecks each selector of each rule expression, andtest_every_alert_rule_selects_only_series_the_stack_servesruns it over every rule. The input metric of a recording rule must therefore be inSERVED_SERIES. [sources: tests/prometheus/test_k8s_monitoring_alerting.py:343, tests/prometheus/test_k8s_monitoring_alerting.py:368, tests/prometheus/test_k8s_monitoring_alerting.py:152]
Fit
Fits in one pull request.
Suspected block
The in-flight observability and caching study must name the series that shows roadmap pending work.
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 (