Skip to content

feat(monitoring): record roadmap pending work after the queue move #4606

Open

Description

@devops-cli-service

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 rules runs over the roadmap-service group written to a rule file
  • THEN promtool prints SUCCESS and 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.yaml runs the new case with a sample series of the metric that the study names
  • THEN promtool prints SUCCESS and the expected sample of devops_cli:roadmap_pending_work:sum holds 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.yaml runs the new case with a sample of job="roadmap-service" and a sample of job="roadmap-intake"
  • THEN promtool prints SUCCESS and the expected series devops_cli:roadmap_pending_work:sum has no job label

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_budget runs
  • THEN the test passes and reports no case of tests/fixtures/prometheus_rules/roadmap_service_tests.yaml above MAX_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_serves runs
  • 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-service group 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_items is 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, under serverFiles.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 as PRODUCT_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]
  • Which rule group holds the new recording rule?: The roadmap-service group 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 in ROADMAP_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-service group. 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.
  • Which form does the name of the recording rule take?: level:metric:operations: devops_cli is the level (the project prefix of the earlier recording rule devops_cli:ai_reference_price_usd_per_token), roadmap_pending_work is the recorded quantity and sum is 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 the devops_cli level 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.
  • Which command proves a criterion about the product rule file?: promtool check rules for the rule file and promtool test rules for its case. docs/TESTING.md requires 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 rules and promtool 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.md says a test that reads a config file is no proof.
  • Which existing tests fail when a group holds a recording rule?: test_the_promtool_files_of_a_group_test_every_alert_of_the_group reads rule["alert"] for every rule of a group, and test_each_unit_tested_rule_fires_on_a_sample_and_stays_quiet_on_a_normal_series does the same. A recording rule has no alert key, so both raise KeyError until they read only the rules that have an alert key. The write-rule test filters by alert name in the roadmap-service-activity group, 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_SERIES hold the input metric of the new rule?: Yes. _unserved checks each selector of each rule expression, and test_every_alert_rule_selects_only_series_the_stack_serves runs it over every rule. The input metric of a recording rule must therefore be in SERVED_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

  1. added
    source/agent
    type/feature
    scope/monitoring
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  2. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    ContributorAuthor

    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/monitoring. The (monitoring) scope of the title gives the scope.
    • Priority: P3-Low. The item is deferred until the observability study names the series, so no work can start now.
    • Value: Medium. The rule keeps pending work visible after the queue move, but no user sees it directly.
    • Effort: Medium. The work needs one recording rule, a promtool test and an update to SERVED_SERIES.
    • Related: feat(monitoring): record the shared roadmap Service selectors #4562, which asks for a different change. Both items add recording rules for the roadmap move, but #4562 records the shared Service selectors and the candidate records pending work only.
  3. added
    priority/p3-low
    on Nov 11, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. added a commit that references this issue on Nov 24, 2026
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/p3-lowscope/monitoringsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions