Repository navigation
Description
Update 2026-11-26 (infra move): the panels and rules are product files under k8s/devops/.
Change k8s/devops/dashboards/roadmap-service-telemetry.json and k8s/devops/monitoring/prometheus-rules-values.yaml. The k8s/monitoring/ values (kube-state-metrics allowlists and scrapes) are in dan-petty/homelab: change them there if a panel needs it. The test is now tests/prometheus/test_k8s_monitoring_alerting.py.
Problem or Motivation
When the roadmap rows move into their own Jobs and Workflows, the pipeline dashboard panels that read the Service lanes lose their source: round timing reads the lane start time, the queue panels read devops_cli_service_queue_depth (the move keeps no queue), and the rollout-kill panel reads jobs_total{result="stopped"}, which a SIGKILL never writes.
Proposed Solution & Architectural Design
- Runs in flight:
kube_pod_labelsandkube_pod_status_phase{phase="Running"}in namespacedevops, with the component labelroadmap-<row>. - Round timing:
row_secondsfrom each pod; optionally an Argo custom metric with{{workflow.duration}}. - Queue: Pending Workflows behind a mutex or semaphore,
argo_workflows_gauge{phase="Pending"}, and the due marks. - Rollout kills: Workflows that end in
ErrororFailed, by row, from an Argo custom counter with{{status}}. - The recording rules change their expressions to the row pods; the alerts read the same recorded series.
- Argo custom metrics in the WorkflowTemplates: a duration gauge and a result counter with labels
repoandrow. - Pod labels hold no
/, so the dashboard joinsroadmap.devops-cli/ownerandroadmap.devops-cli/repowithlabel_joininto therepoform of the metrics.
Target Subsystem
Kubernetes & Minikube Automation (dashboards and rules in k8s/devops/dashboards/ and k8s/devops/monitoring/, WorkflowTemplates in k8s/devops/).
Existing Tool Considered
Argo Workflows custom metrics, kube-state-metrics and Prometheus recording rules (configuration of open tools). Cost: about 250,000 tokens and 3 hours, about 5,000 tokens a month to keep.
Acceptance Criteria
- The runs-in-flight, timing, queue and rollout-kill panels show the runs of the moved rows; pod queries select namespace
devops. - Each alert that read a recorded series still fires in its promtool test with series from a row pod.
- Each counter that a row pod sends starts at 0 before its first increment.
- No label holds an issue number or a Workflow name.
Dependencies
- "feat(roadmap): run each stage item in its own Job".
- "feat(k8s): let Argo Workflows run roadmap pods in devops".
- feat(roadmap): a dashboard and alerts for the pipeline #3655 (the pipeline dashboard).
- "feat(monitoring): record the shared roadmap Service selectors".
Source: #4517
Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-25, maintained.
Reason: Searches found no maintained tool that ships these pipeline panels; the need is configuration of tools the project already runs. Argo Workflows supplies the Workflow phase counts and template metrics, but not the pod-level or per-row series.
Covers:
- Workflow phase counts for the queue panel
- Custom WorkflowTemplate metrics for duration and result
- Workflow end status Error or Failed for rollout kills
Lacks:
- Running row pods from kube-state-metrics pod series
- Per-row split of Pending Workflows; only a status label
- Dashboard queries, recording rules and promtool fixtures
- Repo label join from owner and repo pod labels
Proposed design
Problem statement
The pipeline dashboard reads the roadmap Service lanes. The roadmap rows move into their own Jobs and Workflows, so the lane start time, the Service queue depth and the row result counter go away. The runs-in-flight, timing, queue and rollout-kill panels lose their source. This change points those panels at the row pods, the existing devops_cli_roadmap_row_seconds histogram and the Argo Workflows metrics. It keeps each alert on its recorded series name and threshold. The due marks need a Service gauge and are deferred.
Acceptance criteria
Requirement: Runs-in-flight panel reads row pods
The runs-in-flight panel query SHALL count the devops pods with app.kubernetes.io/component=roadmap-<row> in phase Running.
Scenario: A running row pod
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with aroadmap-refinepod in namespacedevopsand its Running phase series of 1. - THEN The query returns one running pod for
roadmap-refineand selects no pod outside namespacedevops.
Requirement: Timing panel reads the row-seconds histogram
The timing panel query SHALL read the devops_cli_roadmap_row_seconds histogram with the labels repo, row and result.
Scenario: A finished row pod
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with a row-seconds histogram sum of 90 seconds and a count of 1. - THEN The timing query returns 90 seconds for that repository and row.
Requirement: Queue panel reads Pending Workflows
The queue panel query SHALL read the Argo Workflows controller count of Workflows with status Pending and MUST read no devops_cli_service_queue_depth.
Scenario: Two Pending Workflows
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with the controller count ofPendingWorkflows at 2 and nodevops_cli_service_queue_depthseries. - THEN The queue query returns 2.
Requirement: Rollout-kill panel reads the result counter
The rollout-kill panel query SHALL count the row Workflows that end in Error or Failed from the Argo result counter by repo and row.
Scenario: A row Workflow ends in Error
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with the result counter at 1 forrepo,rowandstatus="Error". - THEN The rollout-kill query returns one kill for that repository and row.
Requirement: Recording rules read row pods
Each recording rule that fed a roadmap alert SHALL read the row pod series with job="roadmap-<row>" and keep its recorded series name.
Scenario: A row pod feeds a recording rule
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool test with aroadmap-refinerow pod series. - THEN The recording rule produces
repo_lane_row:devops_cli_service_jobs_total:increase1hwith therepo,lane,rowandresultlabels.
Requirement: Alerts keep their name, labels and threshold
Each alert that read a recorded series of a roadmap row MUST keep its alert name, labels and threshold.
Scenario: Promtool test of RoadmapServiceJobsFailing
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool test with the recorded series from aroadmap-refinerow pod. - THEN
RoadmapServiceJobsFailingfires with the alert name, labels and threshold that the test pinned before the change.
Requirement: Counter panel shows zero
Each panel query that reads a counter MUST return 0 when the counter has no series.
Scenario: No counter series
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with no series of the result counter. - THEN The query returns the value 0 and not an empty result.
Requirement: No label holds an issue number or a Workflow name
No label of the metrics that this change adds or of the panel queries MUST hold an issue number or a Workflow name.
Scenario: A pod carries its item label
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with a row pod that carrieslabel_roadmap_devops_cli_item="4577". - THEN No label of the query result holds the value
4577or a Workflow name.
Requirement: Panel query joins the pod labels into repo
The pod panel query SHALL join label_roadmap_devops_cli_owner and label_roadmap_devops_cli_repo into the repo label with label_join.
Scenario: A row pod label join
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.pyruns the promtool query test with a row pod that carrieslabel_roadmap_devops_cli_owner="dan-petty"andlabel_roadmap_devops_cli_repo="devops-cli". - THEN The query result holds
repo="dan-petty/devops-cli".
Requirement: The monitoring manifests render
The changed dashboard and rule manifests MUST pass the k8s check.
Scenario: The k8s row
- WHEN
uv run devops ci --check --only k8sruns. - THEN The k8s row exits 0.
Existing Tool Considered
Argo Workflows (argoproj/argo-workflows) has the verdict in-use in the alternatives check in the issue body. The block gives the reason and what it covers and lacks. The proposal does what the block lists as lacks: kube-state-metrics pod labels and phase for runs-in-flight, the existing devops_cli_roadmap_row_seconds histogram for timing, and label_join for the repo label. The queue panel shows the controller's Pending total because the count has no per-row label. The change builds no code; the body estimates about 250,000 tokens and 3 hours, and about 5,000 tokens a month to keep.
Key questions
- Which product files hold the dashboard and the alert rules?: The dashboard is
k8s/devops/dashboards/roadmap-service-telemetry.json. The alert rules arek8s/devops/monitoring/prometheus-rules-values.yaml. Thek8s/monitoring/values are in dan-petty/homelab and this change does not edit them. [sources: k8s/devops/dashboards/roadmap-service-telemetry.json, k8s/devops/monitoring/prometheus-rules-values.yaml] - Which test proves the dashboard queries and the alert rules?: The test is
tests/prometheus/test_k8s_monitoring_alerting.py. The infra move changed the path fromtests/test_k8s_monitoring_alerting.py. [sources: tests/prometheus/test_k8s_monitoring_alerting.py] - Which series does the runs-in-flight panel read?: The panel reads kube-state-metrics pod series in namespace
devops. It joinskube_pod_labels{label_app_kubernetes_io_component=~"roadmap-.+"}onpodwithkube_pod_status_phase{phase="Running"}. ADR 0022 putsapp.kubernetes.io/component: roadmap-<row>on each row pod. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md]- Chosen: kube-state-metrics pod series. The pod lives for the whole row and holds the component label. One query shows the running rows.
- Rejected: Argo controller count. The controller count has only a status label. It cannot split the running rows.
- Rejected: Argo custom realtime gauge. It needs a metric for each row and a template change for each row.
- Which series gives the round duration of a row?:
devops_cli_roadmap_row_secondsis the histogram that the row runner already sends. It holdsrepo,rowandresult. The panel reads the histogram sum and count. No Argo duration gauge is added. (best practice) [sources: src/devops_cli/telemetry/instruments.py, src/devops_cli/roadmap/run.py, docs/TELEMETRY.md, openspec/specs/metric-instruments/spec.md]- Chosen: existing row-seconds histogram. It already holds the seconds of each row by repo, row and result. It is tested and is the source that the body names first.
- Rejected: Argo custom gauge from
{{workflow.duration}}. It adds a second series for a measurement that exists. It adds a custom metric to every WorkflowTemplate. - Rejected: pod start time. A pod restart or a retry resets the start time. The image pull adds to it.
- Which series gives the queue depth after the Service queue goes?: The Argo Workflows controller count of Workflows with status
Pendinggives the queue depth. A Workflow waits inPendingwhile a mutex or a semaphore holds it. The controller count holds only astatuslabel. The panel shows the phase total and no per-row split. The query reads nodevops_cli_service_queue_depth. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: Argo controller Pending count. A Workflow waits in Pending while a mutex or a semaphore holds it. The controller reports it with no code.
- Rejected: keep
devops_cli_service_queue_depth. The Service runs no row after the move. The lane queue that the gauge measures goes. - Rejected: custom gauge for each row. A Pending Workflow runs no pod. It emits no custom metric.
- Which series gives a rollout kill of a row?: A custom counter in each WorkflowTemplate holds
repo,rowandstatus. Its value is 1 when the Workflow ends. The panel sums theErrorandFailedseries. A SIGKILL ends the Workflow inError. Only the controller sees that end. No panel readsresult="stopped"today. This change adds the rollout-kill panel. (best practice) [sources: k8s/README.md]- Chosen: Argo custom result counter. The WorkflowTemplate emits it for every end status. A SIGKILL ends the Workflow in Error.
- Rejected:
jobs_total{result="stopped"}. A SIGKILL writes no stopped result. The panel misses the kill. - Rejected: pod phase
Failed. A pod fails for many reasons that are no rollout kill.
- How does the dashboard get the
repolabel of a pod series?:label_joinin the panel query joinslabel_roadmap_devops_cli_ownerandlabel_roadmap_devops_cli_repointorepo. The join stays in the query. No new recording rule is added for the pod series. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md, k8s/devops/dashboards/roadmap-service-telemetry.json]- Chosen:
label_joinin the panel query. It builds owner/name once in the query. No new recording rule is added or kept for the pod series. - Rejected: new recording rule. The panel needs the label only for display. A recording rule adds a series to keep.
- Rejected: one repo pod label. A Kubernetes label value cannot hold /.
- Rejected: pod annotation. kube-state-metrics does not export an annotation as a label.
- Chosen:
- How does a panel show 0 before the first counter event?: End the panel query with
or on() vector(0). The empty label list matches every series on the left. The 0 is returned only while the counter has no series. The other counter panels of this dashboard use the same fallback. (best practice) [sources: k8s/devops/dashboards/roadmap-service-telemetry.json]- Chosen:
or on() vector(0)in the panel query. The panel shows 0 and not an empty result before the first event. The 0 disappears as soon as a series exists. - Rejected: register the counter at 0. Argo emits a workflow-level custom metric only when the Workflow ends. No code can register it earlier.
- Rejected: Grafana noValue override. It leaves the query empty. The criterion requires the query itself to return 0.
- Chosen:
- Which
jobdo a row pod's series carry, and do the roadmap alerts select it?: A row pod setsOTEL_SERVICE_NAME=roadmap-<row>. Prometheus names an OTLP series byservice.nameasjob. Its series carryjob="roadmap-<row>". The roadmap alerts read recorded series such asrepo_lane_row:devops_cli_service_jobs_total:increase1h. Those series carry nojoblabel. The recording rules must read the row pods. The alerts keep their names, labels and thresholds. [sources: docs/TELEMETRY.md, k8s/devops/monitoring/prometheus-rules-values.yaml, tests/fixtures/prometheus_rules/roadmap_service_tests.yaml] - Which label names does kube-state-metrics serve for the roadmap pod labels?:
label_roadmap_devops_cli_owner,label_roadmap_devops_cli_repoandlabel_roadmap_devops_cli_itemare the label names. kube-state-metrics prefixeslabel_and replaces.,-and/with_. The item label holds the issue number. A panel query must drop it. [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md] - Does a counter that a row pod sends hold a zero sample before its first increment?: Yes on the OTLP path. The Service starts each label set of its counters at zero. The collector sends the created timestamp with remote write 2.0. Prometheus writes a zero sample at the start of each series.
increase()counts the first value. The/metricsscrape gets no such sample. [sources: docs/TELEMETRY.md, k8s/README.md]
Fit
Fits in one pull request.
Suspected block
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.The dashboard loses its data source after the migration, but the pipeline itself still runs; this is a visibility gap, not a functional failure.Users lose pipeline visibility (runs, timing, queue, kills) until this is done, but the pipeline keeps working.Requires new Argo custom metrics, updated recording rules, changed panel queries, and promtool alert verification.Both concern pipeline monitoring metrics, but #3069 delivers the metrics themselves while this candidate updates the dashboard panels and recording rules to read from Workflow runs and row pods.devops-cli-service commentedon Nov 11, 2026
Refine cannot set this item to Ready at 818ac6f while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 13, 2026
Alternatives check: in-use
Reason: Argo Workflows, the project's workflow engine, already reports Workflow status through Prometheus and lets each WorkflowTemplate define Prometheus custom metrics, so the queue panel (Pending Workflows) and the rollout-kill result counter are configuration rather than new code. It does not cover the whole issue: the controller's Workflow count has only a status label (no per-row Pending split), and the per-row runs-in-flight panel needs kube-state-metrics pod labels and pod phase, while round timing comes from the existing
devops_cli_roadmap_row_secondshistogram.The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows)
Covers:
{{workflow.duration}}and{{status}}, so a duration gauge and a result counter byrepoandrowneed no codeLacks:
statuslabel, so the queue panel can show only the phase totalkube_pod_labelsandkube_pod_status_phasefor namespacedevopsdevops_cli_roadmap_row_secondshistogram, not from Argo, and no Argo duration gauge is wantedrepojoin (label_joinon the owner and repo labels) is outside ArgoTools considered:
Searches run:
Sources:
Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.