Repository navigation
Description
Problem
The roadmap Service records the outcomes of the pipeline in job records and labels. No metric shows the implement outcomes by item class, the repair rounds, the tokens per delivered item, or the same failure class in a row. devops_cli_roadmap_stage_total counts the plans, but it has no repo label, so a reader cannot split the count by repository.
Expected
This item delivers the metrics. #3655 holds the dashboard and the alerts, and it starts after this item.
devops_cli_service_implement_jobs_total{repo,item_class,result}: one count for each runner Job that a round reports.devops_cli_service_implement_repair_rounds_total{repo,item_class}anddevops_cli_service_implement_tokens_total{repo,item_class}: counters. A panel divides them by the count of delivered items.devops_cli_service_implement_consecutive_failures{repo,class}: a gauge that holds how many stops in a row have this class. A kept state record holds the value over a restart.- The label
repoondevops_cli_roadmap_stage_total. This item adds no second plans counter. - The repair-round count of each run in the job record, because only the runner knows it.
The Service emits the new series from _report in src/devops_cli/roadmap/implement_submit.py, on /metrics through GLOBAL_METRICS.
Acceptance criteria
- Every new metric has a test that it is emitted.
- Each new counter has each label set at zero from the start of the Service, as fix(telemetry): Service counters read true across pods and repos #3495 does for the failure counter.
- No new metric has an issue number in a label. The label
classholds only values ofFailureClass. - A test makes a new Service state from a kept record and reads the same gauge value.
- A stop of another class and a delivered item each set the gauge of the earlier class to zero.
-
k8s/README.mdanddocs/TELEMETRY.mdlist each new metric and its labels.
Moved
- The dashboard, its GitOps provision and its panel checks: feat(roadmap): a dashboard and alerts for the pipeline #3655.
- The alerts and their runbook entries: feat(roadmap): a dashboard and alerts for the pipeline #3655.
- Panel agreement with
devops roadmap explain: this criterion cannot hold. feat(roadmap): a dashboard and alerts for the pipeline #3655 compares the panels with the job record, and feat(roadmap): report pipeline outcomes in roadmap explain #3217 holds the outcomes inexplain. - The defect rate of plans: feat(roadmap): measure plan defect rate after plan verification #3162. The time in a status and its alert: delivered by feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919.
Dependencies
Related
#3027 (tracker), #3650 (counts kept work by class and outcome, and overlaps the counters of this item: the item that merges second adds its label to the counter that exists and adds no second counter), #3065 (failure classes), #3066 (budgets that read implement.spend).
Alternatives check of 2026-11-04: partly.
Tool: grafana/grafana (https://github.com/grafana/grafana), AGPL-3.0, last activity 2026-11-04, maintained.
Proposed design
Problem statement
The roadmap Service records pipeline outcomes in job records and labels. It emits no bounded metrics for implement outcomes by item class, repair rounds, tokens per delivered item, or consecutive failures by class. devops_cli_roadmap_stage_total has no repo label. This change adds those metrics and the repo label, and records repair rounds in the job record. The dashboard and alerts stay in #3655.
Acceptance criteria
Requirement: Implement job outcome counter
The roadmap Service SHALL increment devops_cli_service_implement_jobs_total with the labels repo, item_class and result once for each runner Job that a round reports.
Scenario: A reported runner Job counts once
- WHEN A round reports a runner Job for repository
owner/repo, item classfeatand resultsucceeded. - THEN The series
devops_cli_service_implement_jobs_total{repo="owner/repo",item_class="feat",result="succeeded"}increases by one.
Requirement: Repair rounds counter
The roadmap Service SHALL increment devops_cli_service_implement_repair_rounds_total with the labels repo and item_class by the repair-round count of each reported implement step.
Scenario: Repair rounds add to the counter
- WHEN A reported implement step records two repair rounds for repository
owner/repoand item classfeat. - THEN The series
devops_cli_service_implement_repair_rounds_total{repo="owner/repo",item_class="feat"}increases by two.
Requirement: Token counter
The roadmap Service SHALL increment devops_cli_service_implement_tokens_total with the labels repo and item_class by the token count that the reported runner Job records.
Scenario: Tokens add to the counter
- WHEN A reported runner Job for repository
owner/repoand item classfeatrecords 1,000 tokens. - THEN The series
devops_cli_service_implement_tokens_total{repo="owner/repo",item_class="feat"}increases by 1,000.
Requirement: Consecutive-failure gauge
The roadmap Service SHALL expose devops_cli_service_implement_consecutive_failures with the labels repo and class, and the gauge SHALL hold the number of stops in a row of that class.
Scenario: A stop increments its class gauge
- WHEN A reported stop has class
testsand the gauge fortestsis 1. - THEN The gauge
devops_cli_service_implement_consecutive_failures{repo="owner/repo",class="tests"}becomes 2.
Requirement: Consecutive-failure gauge persists
The roadmap Service SHALL keep the consecutive-failure gauge value in a state record and SHALL report the same value after a restart.
Scenario: A restart keeps the gauge value
- WHEN A Service stops with
devops_cli_service_implement_consecutive_failures{repo="owner/repo",class="tests"}at 2 and a new Service starts from the same state record. - THEN The new Service exposes the same gauge value 2.
Requirement: Different class resets the earlier gauge
The roadmap Service SHALL set the consecutive-failure gauge of a class to zero when a stop of another class follows.
Scenario: A different class resets the earlier gauge
- WHEN The gauge for class
testsis 2 and the next reported stop has classtimeout. - THEN The gauge for
testsbecomes 0 and the gauge fortimeoutbecomes 1.
Requirement: Delivered item resets the earlier gauge
The roadmap Service SHALL set the consecutive-failure gauge of a class to zero when a delivered item follows.
Scenario: A delivered item resets the earlier gauge
- WHEN The gauge for class
testsis 2 and a runner Job reports a delivered item. - THEN The gauge for
testsbecomes 0.
Requirement: Plan counter repository label
The roadmap Service SHALL add the label repo to devops_cli_roadmap_stage_total and SHALL NOT add a second plans counter.
Scenario: A staged item carries its repository
- WHEN A stage round counts a staged item for repository
owner/repo. - THEN The series
devops_cli_roadmap_stage_total{repo="owner/repo",result="staged"}increases by one and nodevops_cli_roadmap_pipeline_plans_totalseries exists.
Requirement: Repair rounds in the job record
The roadmap Service SHALL record the integer repair-round count of each implement step in the item job record from StepOutcome.repair_rounds.
Scenario: A step with repair rounds is recorded
- WHEN An implement step ends with two repair rounds.
- THEN The item job record holds the integer
2for the step's repair-round count.
Requirement: Zero label sets at Service start
The roadmap Service MUST create each new counter label set at zero from the start of the Service.
Scenario: A new Service exposes zero counter series
- WHEN A Service starts with repository
owner/repoand item classesfeatandfix. - THEN Each new counter exposes a zero series for each known label set before any runner Job is reported.
Requirement: Bounded labels
No new metric SHALL have an issue number in a label, and the label class SHALL hold only values of FailureClass.
Scenario: A failure label uses a bounded class
- WHEN The Service records a stop with failure class
tests. - THEN The gauge uses
class="tests"and no new metric series has a label whose value is an issue number.
Requirement: Metric emission tests
Every new metric MUST have a test that asserts the Service emits it.
Scenario: A new metric lacks an emission test
- WHEN The test suite runs over the metric definitions.
- THEN The suite fails and names the metric without an emission test.
Requirement: Metric documentation
k8s/README.md and docs/TELEMETRY.md SHALL list each new metric and its labels.
Scenario: The docs list a new metric
- WHEN A documentation test reads the new metric names from the Service.
- THEN Each name and its labels appear in both
k8s/README.mdanddocs/TELEMETRY.md.
Existing Tool Considered
Grafana (https://github.com/grafana/grafana, AGPL-3.0, maintained, last activity 2026-11-04) covers dashboard rendering and provisioned ConfigMaps. It lacks the pipeline metrics, alert rule evaluation and promtool tests, a failure-class vocabulary and bounded labels, a metric-emission test per metric, a runbook entry per alert, and panel agreement checked against the job record. No existing tool emits the Service metrics. The written cost of the Service instrumentation, state record and tests is about 20k tokens to build, keep and fix, and about 2 days elapsed.
Key questions
- Which existing metric counts a plan, and does this item need a second plans counter?: No second plans counter is needed. The Service already counts each staged item in
devops_cli_roadmap_stage_totalbyresultinemit_stage_results. This item adds therepolabel to that counter. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/telemetry/instruments.py, k8s/README.md]- Chosen: Extend devops_cli_roadmap_stage_total with repo. It counts the same staged event once and keeps one plans series.
- Rejected: Add devops_cli_roadmap_pipeline_plans_total. It counts the same event twice and adds a second plans counter.
- Which transport, names and labels do the new metrics use?: The Service emits them from
_reporton/metricsthroughGLOBAL_METRICS. The names use thedevops_cli_service_prefix. The failure label isclass. The counters replace histograms, becauseGLOBAL_METRICS.record_histogramtakes no buckets. The existing stage counter stays on OTLP. (best practice) [sources: src/devops_cli/roadmap/implement_submit.py, src/devops_cli/telemetry/metrics.py, tests/prometheus/test_implement_failure_labels.py, k8s/README.md]- Chosen: Service metrics path with devops_cli_service_ prefix. It matches the existing failure counter and the Service scrape path.
- Rejected: OTLP emit with devops_cli_roadmap_pipeline_ names. It mixes transports and the histogram path has no buckets for tokens.
- Rejected: Use failure_class as the label. The existing failure counter and its test use class.
- How does the consecutive-failure gauge stay correct across a Service restart?: Use a kept state record like
FailureLedger: read it when the Service starts, write it at each gauge change, and report the gauge at start. Alerts readmax by (repo, class). (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/implement_submit.py, k8s/README.md]- Chosen: Kept state record. It holds the gauge over a restart and matches the failure ledger pattern.
- Rejected: In-memory gauge only. Each pod has its own series and a restart starts at zero, so three in a row never shows.
- Where does the Service get the repair-round count for the job record?: It reads
StepOutcome.repair_roundsinsrc/devops_cli/roadmap/implement_step.py:355and writes the integer to the item job record when_reportruns. [sources: src/devops_cli/roadmap/implement_step.py:355, src/devops_cli/roadmap/implement_submit.py, src/devops_cli/roadmap/store.py] - Where does the Service get the token count for a reported Job?: It reads the token count from the job record key
implement.spendthat the runner writes. feat(roadmap): cost and token budgets per item and per day #3066 budgets read the same key. [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/implement_submit.py, docs/ROADMAP_WORKFLOW.md] - Does the failure-class vocabulary need a person decision?: No.
FailureClassinsrc/devops_cli/roadmap/failure.pyholds the classes, andimplement.failurerecords the class of a stop. [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/implement_submit.py, tests/prometheus/test_implement_failure_labels.py] - Which labels separate item class from failure class?: Use
item_classfor the Conventional Commit type of the item. Useclassfor theFailureClassvalue. Do not use an item label, because an issue number gives unbounded series. (best practice) [sources: k8s/README.md, docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/failure.py, tests/prometheus/test_implement_failure_labels.py]- Chosen: Separate item_class and class labels. Each alert and panel selects one dimension, and both labels stay bounded.
- Rejected: One class label. It mixes item types with failure classes, so the alerts cannot select one dimension.
- Rejected: An item label with the issue number. An issue number gives unbounded series.
- Does this item overlap feat(roadmap): count kept work by failure class and outcome #3650, and how do the counters merge?: Yes.
devops_cli_service_implement_failures_totalhasclassand no outcome. The new jobs counter hasresultand noclass. The item that merges second adds the label it needs to the counter that exists and adds no second counter. This item adds no kept-work outcome. (best practice) [sources: src/devops_cli/roadmap/implement_submit.py, k8s/README.md]- Chosen: Keep the jobs counter with result; feat(roadmap): count kept work by failure class and outcome #3650 adds class if it merges second. It avoids two counters for one runner Job.
- Rejected: Add an outcome label to the failure counter now. This item does not require a kept-work outcome and feat(roadmap): count kept work by failure class and outcome #3650 owns it.
- Are the dashboard and alerts part of this item?: No. This item delivers the metrics only. feat(roadmap): a dashboard and alerts for the pipeline #3655 holds the dashboard, its GitOps provision, its panel checks, the alerts and their runbook entries. (best practice) [sources: k8s/monitoring/dashboards/kustomization.yaml, k8s/monitoring/prometheus-values.yaml, k8s/README.md]
- Chosen: Metrics only; dashboard and alerts stay in feat(roadmap): a dashboard and alerts for the pipeline #3655. It keeps this item within one pull request and avoids duplicate work.
- Rejected: Include the dashboard and alerts here. The original scope exceeds one pull request and duplicates feat(roadmap): a dashboard and alerts for the pipeline #3655.
- Does this item fit one pull request after the dashboard and alerts move to feat(roadmap): a dashboard and alerts for the pipeline #3655?: Yes. The metrics, the job-record field and their tests change
src/devops_cli/roadmap/and its tests, and fit one pull request. (best practice) [sources: src/devops_cli/roadmap/implement_submit.py, tests/roadmap/test_roadmap_implement_submit.py, k8s/README.md]- Chosen: One pull request for the metrics. The remaining change is bounded to the Service metrics and their tests.
- Rejected: One pull request for metrics, dashboard and alerts. The original scope is more than 2,000 added lines.
- Does feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919 still provide the stuck-item metrics that this item must use?: No. feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919 is closed. feat(telemetry): measure how long roadmap items wait in each state #3601 delivered
devops_cli_roadmap_item_age_seconds,devops_cli_roadmap_oldest_item_number,devops_cli_roadmap_claim_age_secondsand theRoadmapServiceItemStuckalert. A panel can read them, and no second state alert is necessary. [sources: k8s/README.md, k8s/monitoring/prometheus-values.yaml]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 1, 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.(roadmap)scope of the title gives the scope.The pipeline works without the dashboard; this improves observability but does not block delivery.Operators gain visibility into pipeline health and early warning, but the core pipeline functions without it.The work spans emitting several metrics, authoring a Grafana dashboard JSON, configuring alerts, writing metric-emission tests, and a runbook entry.Both belong to the pipeline tracker; #3027 is the umbrella for the whole pipeline while the candidate is one deliverable (dashboards and alerts) within it.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at 9179b22 (see proposed design in issue body).
Moved to new items: #3162.
dan-petty commentedon Nov 2, 2026
This item cannot be built as written. A read of the code at
main(5dc4da7c) found these causes. They come from a read-only check by an agent; no code was changed, and I did not repeat the checks.devops roadmap explain(src/devops_cli/roadmap/explain.py, specroadmap-explain) printsyesornoand the first rule that stops the stage job and the implement job. It reports no outcome counts, durations, repair rounds or tokens, so no panel value can equal anexplainvalue. Its docstring says it does not read the Service's failure ledger.itemlabel is unsafe. An issue number as a label gives unbounded series. The repository bounds labels (bounded_label, fix(ai): bound the number of prewarm model label values #2742). Each metric needs a bounded set such asitem_classorresult.OTEL_SERVICE_NAME=devops-cli-job(k8s/devops/cronjob-runner.yaml), and the Service usesroadmap-service(k8s/devops/roadmap-service/deployment.yaml). Every existing roadmap alert selectsjob="roadmap-service". A counter from the runner and a gauge from the Service do not join withoutignoring(job, instance)and matching labels. Repair rounds exist only in the runner (StepOutcome.repair_rounds,implement_step.py:355). The job record'simplement.spendholds only requests and tokens.implement.stopped, the step name. Nothing records three failures in a row of one class. The Service's failure counts are per job and row, not per item.devops_cli_service_jobs_totalcounts Service rounds, not implement outcomes. No instrument hasitem_classorfailure_class.tests/prometheus/test_k8s_monitoring_alerting.py,tests/prometheus/test_k8s_monitoring_dashboards.pyandtests/telemetry/test_telemetry_instruments.py.A buildable scope needs an owner decision on the failure-class vocabulary. A possible shape: drop the panel-agreement requirement; leave state age to #2919 and the plan defect rate to #3162; let the Service be the only emitter, from
_reportinimplement_submit.py, with bounded labels (item_class,resultorfailure_class); add the repair-round count to the job record; write the alerts withjob="roadmap-service"and promtool tests; add the dashboard to thegrafana-devops-cli-dashboardsentry and one runbook entry for each alert.Generated by Claude Code
devops-cli-service commentedon Nov 2, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
16 remaining items
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at f6d57ec (see proposed design in issue body).
dan-petty commentedon Nov 7, 2026
Answer from project standards: three issues of #3027 add metrics with the labels
repo,row,stepandresult:Keep the label scheme of this item:
repo,item_class,resultandclass. Use the label namesrepo,rowandresultin the same way in all items, so a dashboard (#3655) joins them. #3666 usesrepoandlanefor a round that fails before its first row.Do not add a second stage counter. The step issues take the row name as an argument and add no
item_classlabel.feat(roadmap): metrics for the pipeline outcomes
feat(roadmap): metrics for the pipeline outcomes
devops-cli-service commentedon Nov 8, 2026
Released in v0.95.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.95.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 22:36 UTC
feat(roadmap): Count kept work by failure class and outcome (#5959)
feat(roadmap): add pipeline dashboard and chart deferred Service metr…