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 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 rules runs over the roadmap-service-recording 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_recording_tests.yaml runs in a directory that holds the group written to roadmap-service-recording.rules.yaml
  • 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_recording_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 devops_cli:roadmap_pending_work:sum holds one sample with no job label

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_budget runs
  • THEN the test passes and reports no case of tests/fixtures/prometheus_rules/roadmap_service_recording_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 list holds the new names

  • WHEN uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k test_the_pending_work_series_are_served runs
  • THEN the test passes and SERVED_SERIES holds devops_cli:roadmap_pending_work:sum and 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 start host
  • THEN the Roadmap Service widget shows the pending work value of devops_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_items is 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-recording group of k8s/devops/monitoring/prometheus-rules-values.yaml, under serverFiles.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, in ROADMAP_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-recording group 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-service group. It holds the alert rules of the Service, and the recorded series of feat(monitoring): record the shared roadmap Service selectors #4562 left it for roadmap-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.
  • 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/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 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.
  • Where does a person read roadmap pending work?: In the Roadmap Service widget of the cluster start page, configured in k8s/startpage/config/services.yaml of 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 Service widget 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.
  • 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_TESTS and RULE_GROUP_TESTS (tests/prometheus/test_k8s_monitoring_alerting.py:134, :160). The tests that touch the product rules are test_promtool_accepts_every_alert_rule, which runs promtool check rules over each rule file (:438), and test_no_promtool_case_evaluates_more_rounds_than_the_budget, which reads only the alert_rule_test and promql_expr_test cases (:452). Neither reads rule["alert"] over every rule, so the earlier plan's test_the_promtool_files_of_a_group_test_every_alert_of_the_group and test_each_unit_tested_rule_fires_on_a_sample_and_stays_quiet_on_a_normal_series are 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 rules for the rule file and promtool test rules for its case. docs/TESTING.md refuses a test that reads a manifest or a config file and names promtool as the tool that checks the alert rules; docs/CLUSTER.md names the two commands and how to write the group to the file that a case file's rule_files names. (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 rules and promtool 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.md says a test that reads a manifest or a config file is no proof, and the test-tree row refuses a new one.
  • Must SERVED_SERIES hold the record name and the input metric of the new rule?: Yes. The body requires it, and the living spec requires SERVED_SERIES to 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.

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

  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
  6. dan-petty commented on Nov 27, 2026

    @dan-petty
    Owner

    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 Service in k8s/startpage/config/services.yaml of dan-petty/homelab. The widget has room for one more value.

  7. devops-cli-service commented on Nov 28, 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

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