Skip to content

feat(roadmap): Emit inbox gauges, add panel, show digest line #2968

Closed

Description

@dan-petty

What happened

Issue #2915 added devops roadmap inbox. Two lines of that issue are not built:

  • "The same list is a Grafana panel (data from the existing metrics path)."
  • The list shows "an image digest not rolled".

The inbox command prints a footer that says the digest is not listed. The panel needs the inbox counts as metrics. Issue #2919 asks for a Grafana panel "next to the inbox panel", so it expects this panel to exist. No issue owns the inbox panel.

What should happen

  • read_inbox (in src/devops_cli/roadmap/inbox.py) feeds one gauge for each of the six categories, by repository. The gauges are declared instruments and are sent through emit.
  • A Grafana panel shows the six counts. feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919 puts its age panel next to it.
  • The inbox lists an image digest that is not rolled, with the command that clears it (devops argo cd apps status devops reads the pin). The read must work where the Service runs, or the line must say that it needs the cluster.

Acceptance criteria

  • A test shows that the gauges equal the counts of the command, with a fake repository.
  • The panel JSON passes the dashboard checks of the repository.
  • A test shows the digest line, or the issue records why the line cannot be built.
  • uv run devops ci passes.

Evidence

Constraint (2026-11-12, from the closed plan #4963): plans run uv run devops docs generate; the option --sync-readme no longer exists (#5198). Of the two new inbox kinds, this item adds stage_retry only; the owner line belongs to #3077; the gauge sends the nine counted kinds and holds at most 63 series (scope evidence, comment 6836020173).

Alternatives check of 2026-11-04: partly.
Tool: weaveworks/grafanalib (https://github.com/weaveworks/grafanalib), Apache-2.0, last activity 2025-12-08, maintained.

Proposed design

Problem statement

Issue #2915 added devops roadmap inbox, and left two lines unbuilt. No metric counts the inbox lines, so no Grafana panel shows the counts. This change declares one gauge for each counted inbox kind, sends it from the inbox command by repository, and adds the inbox panel to the product dashboard. The image digest line is a separate issue, #4832.

Acceptance criteria

Requirement: Inbox gauge is a declared instrument

The telemetry instruments module SHALL declare devops_cli_roadmap_inbox_items as a gauge with the unit 1 and SHALL list it in INSTRUMENTS.

Scenario: Instrument list holds the inbox gauge

  • WHEN The telemetry instruments are listed
  • THEN The list holds devops_cli_roadmap_inbox_items with kind Gauge and unit 1

Requirement: Gauges match the inbox counts

inbox_cmd SHALL send one value of devops_cli_roadmap_inbox_items for each counted kind of the lines that read_inbox returns, with the repository name as repo and the kind as kind.

Scenario: Fake repository with known counts

  • WHEN A fake repository returns two blocked lines, one refine line, and no line of the other counted kinds
  • THEN The emitted gauges show 2 for blocked, 1 for refine, and 0 for each other counted kind, and each series carries the repository name

Requirement: Gauge stays within the series cap

The gauge MUST hold at most 63 series when the inbox command reads seven repositories.

Scenario: Seven repositories

  • WHEN The inbox command reads seven repositories that hold a line of each counted kind
  • THEN The gauge holds at most 63 series, and each series has a repo label of the seven repositories and a kind label of a counted kind

Requirement: Stage retry lines are listed and counted

read_inbox SHALL return one stage_retry line for an open item whose job record holds a stage failure class, and the gauge SHALL count that line.

Scenario: Item with a stage failure class

  • WHEN A fake repository holds an open item whose job record holds stage.failed_class with the value limit_reached
  • THEN read_inbox returns one stage_retry line that names limit_reached, and the gauge shows 1 for kind stage_retry

Requirement: Inbox panel passes the dashboard lint

The inbox panel in k8s/devops/dashboards/project-metrics.json SHALL pass the dashboard lint of the repository and SHALL read devops_cli_roadmap_inbox_items through last_over_time.

Scenario: Panel JSON validation

  • WHEN The dashboard lint runs on k8s/devops/dashboards/project-metrics.json
  • THEN The lint reports no error, the panel query names devops_cli_roadmap_inbox_items inside last_over_time, and the panel overlaps no other panel

Requirement: Product dashboard folder keeps its three files

The change SHALL add the inbox panel to an existing product dashboard, and k8s/devops/dashboards/ SHALL hold exactly ai-spend.json, devops-cli.json and project-metrics.json.

Scenario: Product dashboard folder

  • WHEN The folder k8s/devops/dashboards/ is listed
  • THEN The folder holds exactly ai-spend.json, devops-cli.json and project-metrics.json

Requirement: Telemetry document lists the inbox gauge

docs/TELEMETRY.md SHALL list devops_cli_roadmap_inbox_items with its kind and unit.

Scenario: Telemetry document row

  • WHEN The telemetry document is read
  • THEN It holds a row for devops_cli_roadmap_inbox_items with kind Gauge and unit 1

Requirement: CI passes

The command uv run devops ci SHALL pass on the branch.

Scenario: Full CI run

  • WHEN The command uv run devops ci runs on the branch
  • THEN Every check passes

Existing Tool Considered

weaveworks/grafanalib (https://github.com/weaveworks/grafanalib), Apache-2.0, last activity 2025-12-08, is maintained. It builds Grafana dashboards and panel JSON from Python code, so it can produce the inbox panel. It lacks the inbox read, the gauge emission through emit, the image digest line, and a check against the dashboard lint of this repository. The project builds the rest itself: the gauge declaration and the emit call (about 60 lines), the stage_retry kind (about 50 lines), the panel JSON (about 60 lines) and the tests (about 140 lines), about 310 lines and roughly 3,100 tokens to build and keep, plus the maintenance of the gauge and the panel, over about one working day. The digest line is #4832.

Key questions

  • Which gauge name and labels carry the inbox counts?: One gauge, devops_cli_roadmap_inbox_items, with the labels repo and kind. A tuple COUNTED_KINDS holds the kinds that it sends: blocked, refine, split, alternatives, failed, stage_retry, claim and labels today, and owner when feat(roadmap): an agent that needs a decision asks on the issue and waits #3077 adds that kind. One series for each pair of repository and counted kind gives 56 series today and 63 when feat(roadmap): an agent that needs a decision asks on the issue and waits #3077 adds owner. (best practice) [sources: src/devops_cli/telemetry/instruments.py, src/devops_cli/roadmap/inbox_kind.py, CONTRIBUTING.md:205]
    • Chosen: One gauge with a kind label. One metric name holds the dimensions. Eight counted kinds for seven repositories give 56 series, and the ninth kind gives 63, inside the cap.
    • Rejected: One gauge for each kind. Nine metric names make the panel query long and the 63-series cap hard to hold.
    • Rejected: One gauge for each repository. The repository is a label. A new repository must not need new code.
  • Where does the gauge emission happen?: In inbox_cmd in src/devops_cli/commands/roadmap.py, after read_inbox returns. The command calls emit_inbox_counts(inbox, repo=target) from src/devops_cli/roadmap/inbox.py, which sends one value for each counted kind. read_inbox stays a pure read, and a test calls emit_inbox_counts with a fake repository. (best practice) [sources: src/devops_cli/roadmap/inbox.py, src/devops_cli/commands/roadmap.py, tests/telemetry/test_telemetry_instruments.py]
    • Chosen: In inbox_cmd, through emit_inbox_counts. read_inbox stays a pure read, and a test calls emit_inbox_counts with a fake repository and reads the collected points.
    • Rejected: Inside read_inbox. Every test that calls read_inbox would send metrics, and the read would no longer be pure.
  • How does the stage_retry kind work?: Add STAGE_RETRY to InboxKind after FAILED, with one line builder that reads the stage failure class from the job record of an open item. The class is the record key stage.failed_class. The line names the class and the step that clears it, and the gauge counts it like the other counted kinds. This item adds stage_retry only: the owner line belongs to feat(roadmap): an agent that needs a decision asks on the issue and waits #3077. (best practice) [sources: src/devops_cli/roadmap/inbox_kind.py, src/devops_cli/roadmap/inbox.py:284, src/devops_cli/roadmap/stores/store.py:262]
    • Chosen: Add STAGE_RETRY to InboxKind. The job record holds stage.failed_class, and the kind gets its own count and its own clearing step.
    • Rejected: Reuse FAILED. A refine failure and a stage failure have different causes and different clearing steps, and one count cannot tell them apart.
  • Which dashboard holds the inbox panel, and how is the panel checked?: k8s/devops/dashboards/project-metrics.json, next to the panel "Oldest Item Age by State" of feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919. The product dashboard folder holds exactly three files, and project-metrics.json holds the item panels. tests/grafana/test_grafana_dashboards.py lints the file, and the telemetry tests of the dashboards read its queries. (best practice) [sources: tests/telemetry/test_telemetry_instruments.py, tests/grafana/test_grafana_dashboards.py, k8s/devops/dashboards/project-metrics.json]
    • Chosen: Add the panel to k8s/devops/dashboards/project-metrics.json. The product dashboard folder holds exactly three files, and project-metrics.json holds the item panels, next to the age panel of feat(telemetry): stuck-item age metrics and one alert for the roadmap #2919.
    • Rejected: Add the panel to devops-cli.json. That dashboard holds the telemetry of the Service and the CLI, not the roadmap item counts.
    • Rejected: Add a new dashboard file. A test asserts that the product dashboard folder holds ai-spend.json, devops-cli.json and project-metrics.json only.
  • Should the panel JSON come from grafanalib?: No. Write the panel into the dashboard JSON file of the repository. The dashboard lint reads JSON files, and one panel needs no generator. (best practice) [sources: tests/grafana/test_grafana_dashboards.py, k8s/devops/dashboards/project-metrics.json]
    • Chosen: Write the panel into the dashboard JSON. The dashboard lint reads JSON files, and one panel needs no generator and no dependency.
    • Rejected: Generate the panel with weaveworks/grafanalib. It adds a dependency and a generation step for one panel, and it lacks the gauge, the digest line and the repository check.
  • Where is the inbox gauge declared?: In INSTRUMENTS in src/devops_cli/telemetry/instruments.py, and sent with emit. A test fails on an emit() of an instrument that INSTRUMENTS does not hold. [sources: src/devops_cli/telemetry/instruments.py:737, CONTRIBUTING.md:205, docs/TELEMETRY.md:86, tests/telemetry/test_telemetry_instruments.py]
  • Which record key holds the stage failure class?: stage.failed_class, the constant FAILED_CLASS in src/devops_cli/roadmap/stores/store.py, which the stage job writes. The key holds a class name and not a file path. [sources: src/devops_cli/roadmap/stores/store.py:262, src/devops_cli/roadmap/stage/stage.py:3093]
  • How are the generated documents regenerated?: Run uv run devops docs generate with no option. The docs row of Static Analysis refuses a generated document that is not the output of its generator, and the option --sync-readme no longer exists. [sources: CONTEXT.md, src/devops_cli/docs/generator.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 5) needs these gauges: the inflow, the outflow and the age of each typed person cause (premise_reject, owner_question, supervise_cap, watch_cycles, the refine waits and intake.duplicate_of), a daily inflow cap, and an alert over the cap. A job writes a cause only after the fixable check and one repair (#4843).

  • Live proof: after the merge, a comment gives the gauge values for 7 days.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    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/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It completes a shipped feature and unblocks #2919, but no user is currently blocked.
    • Value: Medium. It gives operators a live view of inbox state and completes the inbox workflow.
    • Effort: Medium. It needs gauge instruments, a panel JSON, a digest read, and tests across two files.
    • Related: feat(roadmap): devops roadmap inbox lists what waits for a person #2915, which asks for a different change. Both concern the roadmap inbox, but #2915 delivers the inbox command while this candidate adds the gauges, the Grafana panel, and the digest line that #2915 left out of scope.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at e093ac8 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Where do Grafana panel JSON files live in this repository? (missing verified source)
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: weaveworks/grafanalib (https://github.com/weaveworks/grafanalib)

    • License: Apache-2.0
    • Last activity: 2025-12-08
    • Maintained: yes

    Covers:

    • Builds Grafana dashboards and panel JSON from Python code, including panel definitions, grid positions and targets, so it can produce the six-count inbox panel JSON.

    Lacks:

    • Does not read the roadmap inbox or turn its six category counts into gauges emitted through the project's telemetry path.
    • Does not provide the image-digest-not-rolled line or the command that clears it.
    • Does not validate the generated JSON against this repository's own dashboard checks, nor does it handle the fallback wording when the cluster is unreachable.

    Searches run:

    • python library generate Grafana dashboard panel JSON
    • Prometheus Python client custom gauge emit metrics

    Sources:

    Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.

  6. changed the title [-]feat(roadmap): inbox counts as gauges, an inbox panel and the image digest line[/-] [+]feat(roadmap): Emit inbox gauges, add panel, show digest line[/+] on Nov 6, 2026
  7. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 64 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(roadmap): inbox counts as gauges, an inbox panel and the image digest line
    • After: feat(roadmap): Emit inbox gauges, add panel, show digest line
    • Source of the summary: the background model
  8. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Scope from the issue stewards plan (2026-11-11)

    The issue stewards plan #4780 (child 9) adds this scope to #2968.

    Problem. No metric counts the stalled items. Thus the census of 2026-11-11 needed a one-off script, and nobody can measure the targets of #4780. The inbox counts refine 97, blocked 19, split 9, alternatives 9 and failed 2. It lists no stage retry (43) and no owner question.

    Added scope.

    Added acceptance criteria.

    • A test shows that the gauges equal the counts of devops roadmap inbox on a fake repository.
    • The gauge has 63 series or fewer (7 repositories x 9 kinds).
    • The panel query passes the dashboard check.

    The steward panels of #4780 read this gauge.

  9. 62 remaining items

  10. removed
    status/in-review
    on Nov 15, 2026
  11. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 12:24 UTC

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/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions