Repository navigation
Description
Problem
The Service counters give a false picture to a person who reads them. These series come from the prometheus_client registry through the /metrics scrape (src/devops_cli/telemetry/metrics.py:10). They split by pod, and each release makes a new pod. A label set has no series until its first increment, so increase() loses the first value.
devops_cli_service_implement_failures_total also has only the label class (src/devops_cli/roadmap/implement_submit.py:253-255), so it mixes 3 repositories.
Evidence in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, with 16 pods in the series:
| class | increase() over 24 h |
sum of the per-pod maximum |
|---|---|---|
ci_infra |
39.0 | 59 |
plan_defect |
0 | 8 |
refused_tool |
7.1 | 12 |
timeout |
7.1 | 9 |
The pod that was live at the start of the window can add earlier counts, so the right column is an upper bound. Stop comments on devops-cli alone show ci_infra 6 and plan_defect 8. So increase() shows ci_infra as the top cause and no plan defect, and nobody can read the split by repository.
Other facts:
k8s/monitoring/prometheus-values.yaml:23: the created-timestamp feature acts on remote write 2.0 from the collector. The_createdseries of the scrape path are stored as plain series.k8s/monitoring/prometheus-values.yaml:665-677: the alert expressions work around the missing first sample (fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505).docs/TELEMETRY.md:22-25says that a new pod writes the series of the pod before it. The scraped series have a pod label, so this is false for them.devops_cli_service_jobs_totalhas the labelslane,repoandresult, and no row label.k8s/README.md:688tells the reader ofRoadmapServiceGitHubRequestsHighto lower the budget. The alert follows the budget, so a lower budget makes it fire sooner.
Not in this item: RoadmapServiceRestarted reads a container restart by design, and RoadmapServiceUnavailable covers a rollout. devops_cli_ai_* has no series for devops-coder, but #3066 owns token spend.
Expected
Each label set of each Service counter exists at 0 from the start. The failure counter has a repo label. A query gives a true total over a pod change. The documents state how the series behave.
Acceptance criteria
- A test: each class of the failure counter exists at 0 for each repository after start.
- A test: the
repolabel holds only values ofservice.repos. - A promtool test: a query gives a true total over a pod change. Add a recording rule only if this test shows the need.
- A test:
devops_cli_service_jobs_totalholds a row label. - A promtool test: the alert expressions hold with the fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505 workaround removed.
docs/TELEMETRY.mdandk8s/README.mdstate the scrape behavior and the labels of the counter.- The action text of
RoadmapServiceGitHubRequestsHighdoes not say to lower the budget.
Existing tool considered
prometheus_client: calling .labels(...) at start creates a child at 0. promtool and the rule tests in tests/fixtures/prometheus_rules/ hold the query results. Prometheus recording rules only if the test needs one.
Order
- feat(roadmap): metrics for the pipeline outcomes #3069 comes after this item. It plans to reuse the class label of this counter, so agree the
repolabel with it.
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(telemetry)scope of the title gives the scope.Incorrect operational data misleads operators but does not break service delivery.The current counters hide the true top failure class and hide per-repo splits, so operators act on wrong data.Requires counter initialisation changes, a new label, docs updates, unit tests, and promtool rule tests across several files.Both address the increase() first-sample gap on Service alerts; #2505 fixed the alert expressions as a workaround, while this candidate fixes the counter itself and removes that workaround.dan-petty commentedon Nov 5, 2026
Answer from project standards, under the owner's instruction of 2026-11-05.
1. Does
devops_cli_service_identity_refused_totalget a zero series?Answer: no. It stays with no zero series. Its label
identityholds the identity that GitHub refuses, so the value of the label is not known before a refusal. The alertRoadmapServiceIdentityRefusedreads> 0with no workaround term. Source:design.mdof the change3495-service-counters-zero-series-repo-label, and the two counts insrc/devops_cli/server/service.py.docs/TELEMETRY.mdandk8s/README.mdstate this exception.2. A round that fails before its first row counts no job. Is this in scope?
Answer: it is a real gap, and it is separate work. A failure of a round has no row, so it needs its own label value or counter and its own alert. No open issue covered it, so #3666 now holds it. Source: AGENTS.md rule 11, and the search of open issues.
3. Which label does
devops_cli_service_implement_failures_totaluse for the repository, and does #3069 agree?Answer:
repo, the label of the other Service counters (devops_cli_service_jobs_total,devops_cli_service_triggers_total). The values are those ofservice.repos. #3069 plansdevops_cli_service_implement_jobs_total{repo,item_class,result}and a gauge with{repo,class}, so it reads the same label, and no further agreement is necessary. Source:src/devops_cli/server/counter_series.py, and the body of #3069.4. Does a live Prometheus query prove the change?
Answer: not before the merge. The series change only after the deploy, and promtool holds the query results offline. The pull request comment holds the queries to run after the deploy. Source: the acceptance criteria of this issue, which ask for promtool tests, and AGENTS.md rule 8.
Two more points came from a read of the final diff, and the branch holds them. Both follow from the count for each row:
RoadmapServiceJobsFailingnow groups and joins onrepo,laneandrow. With a join on the lane, the rowmetricssucceeds in each round of the status lane and hides a failed row of that lane.result="stopped", as a round did before (fix(service): a round that ends because the Service is stopping counts as a failure and three of them suspend a row #2753), and not undererror.devops-cli-service commentedon Nov 5, 2026
Released in v0.63.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.63.0
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 19:48 UTC