Repository navigation
Description
Problem or Motivation
No metric counts the open roadmap items of each repository by Status and plan, or the claims by claimant kind. The pipeline dashboard (#3655) needs both. Prometheus cannot count GitHub labels by itself.
Proposed Solution & Architectural Design
- In
src/devops_cli/telemetry/instruments.pyandsrc/devops_cli/github/metrics.py(beside_emit_item_ages, line 932): two gauges from the same snapshot,devops_cli_roadmap_items{repo, state, plan}anddevops_cli_roadmap_claims{repo, claimant}(claimant kind:service,agent,human). - The label is
claimant, notowner, becauseownermeans the GitHub owner in the naming ADR. - A label set that the last snapshot sent and this one lacks gets 0 once, as
_emit_item_countsdoes (github/metrics.py:906-916). - Related: feat(roadmap): Emit inbox gauges, add panel, show digest line #2968 (inbox gauges by category) uses the same snapshot path; keep the two gauge families apart.
Target Subsystem
SDLC, Git & PR Governance (roadmap metrics: src/devops_cli/github/metrics.py).
Existing Tool Considered
No tool counts GitHub labels without a GitHub read; the existing metrics snapshot reads them already. Cost: about 150,000 tokens and 2 hours to build, about 5,000 tokens a month to keep, about 20,000 tokens to fix.
Acceptance Criteria
- Each snapshot sends the count for each pair of Status and plan, and 0 for each pair with no item.
- A label set that the last snapshot sent and this one lacks gets 0 once.
- The snapshot sends no extra GitHub request (a test counts requests).
- No label holds an issue number, and no label is named
owner. - The pipeline dashboard shows the open items and claims by repository.
Dependencies
- feat(roadmap): a dashboard and alerts for the pipeline #3655 (the pipeline dashboard).
Source: #4517
Proposed design
Problem statement
The roadmap sends no metric that counts its open items by Status and by the stage pull request flag. It also sends no metric that counts their claims by claimant kind. The pipeline dashboard (#3655) needs both counts for each repository. Prometheus cannot count GitHub labels alone, so the metrics row must send the counts from the snapshot that it already reads.
Acceptance criteria
Requirement: Gauge instruments
The telemetry module SHALL define devops_cli_roadmap_items and devops_cli_roadmap_claims as gauges with unit 1.
Scenario: Both gauges are registered
- WHEN a test imports
INSTRUMENTSfromdevops_cli.telemetry.instruments - THEN the tuple holds both names, each with kind
GAUGEand unit1.
Requirement: Items per Status and plan
A snapshot SHALL send one devops_cli_roadmap_items sample for each pair of Status and plan, with 0 for a pair that holds no open item.
Scenario: Every pair gets a sample
- WHEN the store holds one open item with Status Ready and no stage pull request
- THEN the snapshot sends 12 samples with labels
repo,stateandplan, the pairreadyandfalsehas 1, and each other pair has 0.
Requirement: Claims per claimant kind
A snapshot SHALL send one devops_cli_roadmap_claims sample for each claimant kind, with 0 for a kind that holds no open item.
Scenario: Each kind gets a sample
- WHEN one open item holds
owner/serviceand no item holdsowner/agentorowner/human - THEN the snapshot sends
claimant="service"with 1, andclaimant="agent"andclaimant="human"with 0.
Requirement: One read of the store
The snapshot MUST read the items of the store once and send no extra GitHub request for the two gauges.
Scenario: The request count is unchanged
- WHEN the metrics row collects a report that holds the two gauges
- THEN the GitHub requests that the fake client recorded equal those of a report without the two gauges.
Requirement: Label values
A series of the two gauges MUST hold no issue number and no label named owner.
Scenario: The label sets are checked
- WHEN the snapshot sends the series of both gauges
- THEN each label name is
repo,state,planorclaimant, and no value is an issue number.
Requirement: A failed read sends nothing
A snapshot whose read of the items fails MUST send no sample of the two gauges.
Scenario: The store raises
- WHEN the read of the items raises
GitHubOperationError - THEN the snapshot sends neither gauge, and the report holds empty item and claim lists.
Existing Tool Considered
No alternatives check has run. The OpenTelemetry Python SDK covers the gauge export, and the repository already uses it in src/devops_cli/telemetry/instruments.py. The SDK cannot count GitHub labels, so the counts come from the store snapshot that collect_project_metrics_report already reads. The body writes the cost of the own code: about 150,000 tokens to build, about 5,000 tokens a month to keep and about 20,000 tokens to fix.
Key questions
- Which library sends the two gauges?: The OpenTelemetry Python SDK, through an
Instrumentof kindGAUGEandemit(), asROADMAP_ITEM_AGEdoes insrc/devops_cli/telemetry/instruments.py. [sources: src/devops_cli/telemetry/instruments.py, src/devops_cli/github/metrics.py:932] - Which label names do the two gauges use?: The items gauge uses
repo,stateandplan, the label set thatROADMAP_AGE_LABELSalready names. The claims gauge usesrepoandclaimant, becauseownernames the GitHub owner and theowner/*label family in this repository. (best practice) [sources: src/devops_cli/telemetry/instruments.py, .github/labels.yml:315, src/devops_cli/roadmap/claim.py]- Chosen: Reuse
ROADMAP_AGE_LABELSand addclaimant. A dashboard joins the count to the age series on the same labels, andclaimantis not ambiguous. - Rejected: Name the claim label
owner.ownermeans the GitHub owner, andowner/*is the label family of the claim itself.
- Chosen: Reuse
- Which values can
stateandclaimanthold?:stateholds the slug of each of the 6 values ofCONST_ROADMAP_STATUS_VALUES.claimantholds one of the 3Claimantmembers:service,agentandhuman. [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/claim.py, src/devops_cli/github/metrics.py:932] - How does a pair or a kind that this snapshot lacks get 0?: The pairs and the kinds are a closed set, so each round sends 0 for every empty pair and every empty kind. The gauges need no memory of the series that the last snapshot sent. (best practice) [sources: src/devops_cli/github/metrics.py:906, openspec/changes/archive/2026-11-05-2919-stuck-item-age-metrics-and-one/design.md]
- Chosen: Send 0 each round for the closed set. The 6 Status values, the 2 plan flags and the 3 claimant kinds are fixed, so a sample of 0 each round keeps no stale value.
- Rejected: Reuse the
_sent_item_seriesmemory of_emit_item_counts. That memory servesPROJECT_ITEMS, whose release, type and priority labels form an open set.
- Where does the snapshot compute the two counts?: In the block that the
item_agesflag already guards, from one read of the items.get_item_age_metricstakes the open items as an optional argument, and a failed read sends no series. (best practice) [sources: src/devops_cli/github/metrics.py, src/devops_cli/github/metrics.py:932]- Chosen: Share one read of the items with the ages. One read keeps the request count the same and gives both gauge families the same snapshot.
- Rejected: Read the items again for the counts. A second read can cost GitHub requests, and the acceptance criteria forbid an extra request.
- Rejected: Add a new row or setting. The metrics row already reads the store, and the two gauges belong to the same snapshot.
- Does this item build the pipeline dashboard panel?: No. This item sends the series, and feat(roadmap): a dashboard and alerts for the pipeline #3655 reads them in its panel. The dashboard panel is feat(roadmap): a dashboard and alerts for the pipeline #3655's work and no test of this repository can check it. (best practice) [sources: src/devops_cli/telemetry/instruments.py]
- Chosen: Send the series here and let feat(roadmap): a dashboard and alerts for the pipeline #3655 build the panel. Each item keeps one scope, and the series are useful to any dashboard before feat(roadmap): a dashboard and alerts for the pipeline #3655 lands.
- Rejected: Build the panel in this item. feat(roadmap): a dashboard and alerts for the pipeline #3655 owns the pipeline dashboard, and this item cannot check a panel offline.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-13: in-use.
The repository already uses this tool.
Tool: open-telemetry/opentelemetry-python (https://github.com/open-telemetry/opentelemetry-python), Apache-2.0, last activity 2026-11-12, maintained.
Owner decision 2026-11-13
The approved pipeline split (tracker #5482) moves the item count to #5495: the gauge devops_cli_roadmap_items{repo, phase} comes from the pure phase(item) function. This item keeps only devops_cli_roadmap_claims{repo, claimant} and emits no second items gauge. The criteria and the requirements of the items gauge in this body do not apply.
- Live proof: after the merge and the release, the Service emits the claims gauge as the App for 24 h. A comment gives the value for each claimant and a compare with the
owner/*labels.
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.(roadmap)scope of the title gives the scope.It feeds the pipeline dashboard (#3655) but does not block a release or fix a defect.It gives operators a per-repository view of open items and claims, which supports the dashboard.The body estimates about 2 hours to build two gauges beside existing code.Both add roadmap metrics in src/devops_cli/github/metrics.py, but #3069 counts pipeline outcomes while this candidate counts open items and claims.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 818ac6f (see proposed design in issue body).
devops-cli-service commentedon Nov 13, 2026
Alternatives check: in-use
Reason: The need splits in two: exporting two labelled gauges, which the OpenTelemetry Python SDK already used by this repository provides, and counting the repository's own roadmap items and claims from a single GitHub snapshot, which no library can do. The searches turned up no tool that counts this repository's GitHub labels per Status, plan and claimant kind, so the SDK covers only the instrument/export part and the counts still need the project's own code.
The repository already uses this tool.
Tool: open-telemetry/opentelemetry-python (https://github.com/open-telemetry/opentelemetry-python)
Covers:
Lacks:
Tools 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.
[-]feat(roadmap): count open items and claims per repository[/-][+]feat(roadmap): count the claims of each repository[/+]devops-cli-service commentedon Nov 17, 2026
Released in v0.172.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.172.0
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 12:22 UTC