Repository navigation
Description
Problem or Motivation
The Service row of devops-cli.json. Panel 10 (AI spend rate, [5m]) peaks at 56.85
Proposed Solution & Architectural Design
Panel 10: bars, panel interval 1h, increase(devops_cli_ai_spend_usd_total[$__interval]), currencyUSD (71.25 $ of 77.32 $, 92 %). Panel 9: keep it, and add a stat of the spend for each day with the thresholds. Panel 38: the mean round duration by lane, increase(devops_cli_service_job_seconds_total[$__rate_interval]) divided by increase(devops_cli_service_jobs_total[$__rate_interval]), unit s, Min step 15m (a round adds its seconds when it ends, src/devops_cli/server/service.py:655-659). Panels 37 and 47: sorted bar gauges, instant over $__range, only rows above 0. Panel 41: sorted bar gauge of the current age. Panel 43: state timeline with value mappings. Panels 44, 48 and 53: stats. Panels 36, 40, 45 and 46: rate over $__rate_interval times 3600, unit '/h'. Panels 50 and 51: bar gauges of the current value; panel 52 split. Panel 34: split into a calls bar gauge and an answer-size table.
Scope: queries, panel types, units, legends and defaults only. Keep the default Grafana colors. The project design study owns colors and type.
Target Subsystem
Kubernetes & Minikube Automation (Grafana dashboards and telemetry).
Existing Tool Considered
Built-in Grafana panel types (bar chart, bar gauge, state timeline, stat, table). No new code.
Acceptance Criteria
- Harness cases for panels 10, 37, 38 and 41: the hourly spend bars add up to the fixture total; panel 38 returns the fixture mean round seconds for each lane; panel 37 returns only rows above 0.
- The lint conditions of the previous devops-cli item stay true for the whole file.
- Live at 7 d: the panel 10 bars add up to at least 90 % of sum(increase(devops_cli_ai_spend_usd_total[7d])) (today 48 %).
Files
k8s/monitoring/dashboards/devops-cli.jsontests/fixtures/dashboard_queries/devops-cli.yaml
Dependencies
Source: #4675
Alternatives check of 2026-11-14: none.
Tool: none found.
Proposed design
Problem statement
The rows that the issue calls the Service row are hard to read. After the product dashboards split, panels 9, 10 and 34 live in k8s/devops/dashboards/devops-ai-rag.json, and panels 36 to 54 live in k8s/devops/dashboards/roadmap-service-telemetry.json. Panel 10 shows an instantaneous rate in $/h, so at 7 d its points add up to 48 % of the spend and its peaks are too high. Panels 37, 41, 43, 47 and 54 draw tens of lines, and panel 38 shows seconds as a duration. Panels 36, 40, 45 and 46 use a fixed 1 h window and unit short, panels 50 to 52 put an average and a count on one axis, panel 34 mixes calls and characters, and panels 44, 48 and 53 show no data. With 13 lanes for each of 7 repositories, the lane panels draw up to 91 lines. The change edits the two dashboard JSON files and their query fixtures to give each panel one unit, a readable type, a title and a description.
Acceptance criteria
Requirement: Hourly AI spend bars
Panel 10 of k8s/devops/dashboards/devops-ai-rag.json SHALL draw sum by (server) (increase(devops_cli_ai_spend_usd_total{job=~"$job"}[$__interval])) as bars with interval 1h, unit currencyUSD and min 0.
Scenario: Seven days of hourly spend bars
- WHEN The harness evaluates the panel 10 query with __interval of 1h over a 7 d fixture whose counter rises by 77.32 USD.
- THEN The case passes under promtool, and the bars add up to at least 90 % of 77.32 USD.
Requirement: Daily spend stat with thresholds
Panel 9 of k8s/devops/dashboards/devops-ai-rag.json SHALL keep the stat of the spend over $__range and the row SHALL add a stat of the spend of the last day, both with unit currencyUSD and the thresholds 50 and 200 USD.
Scenario: One day of spend
- WHEN The harness evaluates the daily stat query sum(increase(devops_cli_ai_spend_usd_total{job=~"$job"}[1d])) or vector(0) over a fixture that adds 30 USD each day.
- THEN The result is 30, and both stat panels hold the thresholds 50 and 200.
Requirement: Mean round duration by lane
Panel 38 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL be a sorted bar gauge with instant data over $__range that shows, for each lane, sum by (lane) (increase(devops_cli_service_job_seconds_total{job="$job",repo="$repo"}[$__range])) divided by sum by (lane) (increase(devops_cli_service_jobs_total{job="$job",repo="$repo"}[$__range])), with unit s.
Scenario: The mean round seconds of two lanes
- WHEN The harness evaluates the panel 38 query over a fixture where lane intake ran 4 rounds of 30 s and lane refine ran 2 rounds of 90 s.
- THEN The result holds 30 for intake and 90 for refine, and the panel unit is s.
Requirement: Sorted bar gauges for the lane, row and class panels
Panels 37, 41, 47 and 54 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL be sorted bar gauges with instant data over $__range that draw only values above 0.
Scenario: A zero row is left out
-
WHEN The harness evaluates the panel 37 query sum by (repo, row) (increase(devops_cli_service_jobs_total{job=
"$job",repo="$repo",result="error"}[$__range])) > 0 over a fixture with two rows above 0 and one row at 0. - THEN The result holds the two rows above 0 and no series for the row at 0, and the panel is a bar gauge.
Requirement: Zero or one gauge as a state timeline
Panel 43 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL be a state timeline with a value mapping for 0 and for 1.
Scenario: Six series of 0 and 1
- WHEN The harness evaluates the panel 43 query over a fixture with six series that hold 0 or 1.
- THEN The query returns the six series, and the panel has type state-timeline with two value mappings.
Requirement: Rates for each hour
Panels 36, 40, 45 and 46 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL show rate(counter{...}[$__rate_interval]) times 3600 with unit /h and min 0.
Scenario: Twelve events each 15 minutes
- WHEN The harness evaluates the panel 36 query over a fixture that adds 12 events each 15 min.
- THEN The result is 48, and the panel unit is /h.
Requirement: Range bar gauges and the split of panels 50 to 52
Panels 50 and 51 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL be bar gauges of the last value over $__range, and panel 52 SHALL split into two panels with one unit each.
Scenario: One unit for each panel of 50 to 52
- WHEN The test reads the panels that replace 50, 51 and 52 from the dashboard JSON.
- THEN Panels 50 and 51 are bar gauges, and each of the two panels that replace 52 holds one unit.
Requirement: Calls and answer sizes in two panels
Panel 34 of k8s/devops/dashboards/devops-ai-rag.json SHALL split into a bar gauge of calls and a table of the mean answer size in characters, and each SHALL hold one unit.
Scenario: The two panels of panel 34
- WHEN The test reads the panels that replace panel 34.
- THEN One panel is a bar gauge for calls with unit short and one is a table for the mean answer size with unit short, and neither holds two units.
Requirement: Error share at the top of the Service row
The Roadmap Service row of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL open with a time series in percentunit from 0 that shows the share of failed Service rounds and the share of rejected webhook deliveries.
Scenario: Seven failed rounds of 100
- WHEN The harness evaluates the failed-rounds query over a fixture with 7 failed rounds of 100 rounds.
- THEN The result is 0.07, and the panel unit is percentunit with a minimum of 0.
Requirement: A stat that shows 0 in place of no data
Panels 44, 48 and 53 of k8s/devops/dashboards/roadmap-service-telemetry.json SHALL be stat panels whose query ends with or vector(0).
Scenario: A series that the fixture does not write
- WHEN The harness evaluates the panel 44 query over a fixture with no matching series.
- THEN The result holds one sample of value 0.
Requirement: The #4707 readability lint stays true
The readability lint of #4707 SHALL pass for every panel of k8s/devops/dashboards/devops-cli.json and for every panel of k8s/devops/dashboards/devops-ai-rag.json and k8s/devops/dashboards/roadmap-service-telemetry.json outside the rows that this change touches.
Scenario: The lint reads the product dashboards
- WHEN The test runs readability_problems over each panel of the three product dashboards outside the rows that this change touches.
- THEN It reports no problem.
Requirement: One unit and a described title for each changed panel
Each panel that this change touches in the two product dashboards SHALL have one unit, a title that names its signal and its measure, and a non-empty description.
Scenario: The changed panels are read
- WHEN The test reads each panel of the rows that this change touches from the two dashboard JSON files.
- THEN Each has one unit, a title with a colon and a non-empty description.
Requirement: The pinned query tests follow the new panels
The tests that pin the Roadmap Service row and the Planner Tool panel SHALL assert the new queries, types and positions of this change.
Scenario: The pinned tests read the new panels
- WHEN The test runs tests/grafana/test_grafana_dashboards.py and tests/telemetry/test_telemetry_instruments.py after the change.
- THEN They pass with the new queries, and no test still asserts a fixed 1 h window or a two-unit panel.
Existing Tool Considered
Grafana (grafana/grafana, AGPL-3.0, active 2026-11-14) ships the built-in panel types that cover the need: a time series with bars, a bar gauge, a state timeline, a stat and a table. It has no tool that rewrites, requeries or lints the project's dashboard JSON, so the change edits k8s/devops/dashboards/devops-ai-rag.json and k8s/devops/dashboards/roadmap-service-telemetry.json by hand and builds no code. It therefore has no build, keep or fix cost in tokens or elapsed time.
Key questions
- Which files hold the panels that the issue calls the Service row?: After the product dashboards split, the panels are in two files. k8s/devops/dashboards/devops-ai-rag.json holds the rows 'AI Spend & Economics' (panels 9 and 10) and 'Planner Tools' (panel 34). k8s/devops/dashboards/roadmap-service-telemetry.json holds the rows 'Roadmap Service' (panels 36 to 48, 53, 54, 60 and 67), 'Alternatives Check' (panels 50 to 52) and 'Roadmap Job Success'. The query fixtures are tests/fixtures/dashboard_queries/devops-ai-rag.yaml and tests/fixtures/dashboard_queries/roadmap-service-telemetry.yaml. The issue's Files section names k8s/monitoring/dashboards/devops-cli.json, which does not exist; the repository's k8s/devops/dashboards/devops-cli.json holds the golden signals and sub-command rows, not these. [sources: k8s/devops/dashboards/devops-ai-rag.json:742, k8s/devops/dashboards/devops-ai-rag.json:795, k8s/devops/dashboards/devops-ai-rag.json:866, k8s/devops/dashboards/roadmap-service-telemetry.json:46, k8s/devops/dashboards/roadmap-service-telemetry.json:80, k8s/devops/dashboards/roadmap-service-telemetry.json:163, k8s/devops/dashboards/roadmap-service-telemetry.json:859, k8s/devops/dashboards/roadmap-service-telemetry.json:988, k8s/devops/dashboards/devops-cli.json:47, tests/fixtures/dashboard_queries/devops-ai-rag.yaml:1, tests/fixtures/dashboard_queries/roadmap-service-telemetry.yaml:1, tests/prometheus/test_k8s_monitoring_dashboards.py:635]
-
Why do the panel 10 points add up to 48 % of the spend at 7 d, and which query and panel form fix it?: The panel draws sum by (server) (rate(devops_cli_ai_spend_usd_total{job=
"$job"}[5m])) * 3600, an instantaneous $/h rate from a 5 min window, so each point is not the spend of its hour and the peaks are too high. The fix is bars in a time series with interval 1h and min 0, using sum by (server) (increase(devops_cli_ai_spend_usd_total{job="$job"}[$__interval])) with unit currencyUSD, as the golden signals traffic panel already does for calls per hour. (best practice) [sources: k8s/devops/dashboards/devops-ai-rag.json:795, k8s/devops/dashboards/devops-ai-rag.json:810, k8s/devops/dashboards/devops-cli.json:142, k8s/devops/dashboards/devops-cli.json:173, k8s/devops/dashboards/devops-cli.json:180]- Rejected: fixed 5 min rate. It does not cover the step of the panel, so the 7 d points add up to 48 % and the peaks are too high.
- Rejected: $__rate_interval rate. It holds one scrape more than the bar, so the bars overlap.
- Rejected: barchart panel. No product dashboard uses the barchart type; the golden signals traffic panel draws hourly bars in a time series with drawStyle bars and interval 1h.
- Chosen: $__interval increase in a time series with bars. It equals the bar width, so the bars add up to the increase of the counter, and it follows the project's hourly-bar pattern.
-
Which panel and query give the daily spend with the thresholds?: Panel 9 is already a stat of sum(increase(devops_cli_ai_spend_usd_total{job=
"$job"}[$__range])) or vector(0) with the thresholds 50 and 200 USD. Keep it, and add a stat of sum(increase(devops_cli_ai_spend_usd_total{job="$job"}[1d])) or vector(0) with the same thresholds, so the thresholds judge one day rather than any selected range. (best practice) [sources: k8s/devops/dashboards/devops-ai-rag.json:742, k8s/devops/dashboards/devops-ai-rag.json:764, k8s/devops/dashboards/devops-ai-rag.json:724, docs/DESIGN.md:233]- Rejected: keep only the range stat. The thresholds 50 and 200 USD then judge a 7 d total, which is not what they mean.
- Rejected: change the range stat to a 1 d stat. It loses the spend of the selected range, which the row already shows.
- Chosen: keep the range stat and add a daily stat with the same thresholds. The row keeps the range total and the thresholds judge the spend of one day.
-
Which query and panel type give the mean round duration for each lane?: Panel 38 becomes a sorted bar gauge with instant data over $__range: sum by (lane) (increase(devops_cli_service_job_seconds_total{job=
"$job",repo="$repo"}[$__range])) divided by sum by (lane) (increase(devops_cli_service_jobs_total{job="$job",repo="$repo"}[$__range])), with unit s. The Service adds the seconds of a round and its count when the round ends. (best practice) [sources: k8s/devops/dashboards/roadmap-service-telemetry.json:163, k8s/devops/dashboards/roadmap-service-telemetry.json:178, src/devops_cli/server/service.py:671, src/devops_cli/server/service.py:672, docs/DESIGN.md:233]- Rejected: busy seconds as a duration. It shows the sum of the seconds, not the mean of one round, and it draws one line for each lane.
- Rejected: time series with top 3 lanes plus Other. It keeps a time series for a breakdown that docs/DESIGN.md C15 says is a sorted table or bar gauge.
- Chosen: sorted bar gauge over $__range. It gives one named bar in seconds for each lane and follows the owner rule for a breakdown of more than 3 entities.
-
How do the lane, row and class panels stay readable when a lane exists for each row?: Panels 37, 41, 47 and 54 become sorted bar gauges with instant data over $__range that draw only values above 0. Panel 38 also becomes a sorted bar gauge over $__range. A panel that stays a time series and groups by lane draws at most 3 series plus Other, or becomes a sorted table or bar gauge. (best practice) [sources: docs/DESIGN.md:233, CONTEXT.md:190, docs/CLUSTER.md:48, k8s/devops/dashboards/roadmap-service-telemetry.json:125, k8s/devops/dashboards/roadmap-service-telemetry.json:314, k8s/devops/dashboards/roadmap-service-telemetry.json:584, k8s/devops/dashboards/roadmap-service-telemetry.json:719]
- Rejected: keep the time series. Thirteen lanes for each repository draw 91 lines, and 77 to 84 rows draw one line for each.
- Rejected: top 3 plus Other on a time series. The top lanes change over time, so a static Other target cannot follow them; the owner asks for a sorted bar gauge or table for these panels.
- Chosen: sorted bar gauge or table over $__range. It gives one named bar or row for each value, sorted from the largest, and draws only the values above 0.
- How many lanes does a repository have?: Thirteen, one for each row of the due table (metrics, implement, stage_ready, stage, release_comments, github_status, cloudflare_status, pr_conflicts, intake, retitle, fix_plan, refine and alternatives), unless service.lanes groups rows into a shared lane. With 7 repositories a panel grouped by repo and lane draws 91 series. [sources: CONTEXT.md:190, docs/CLUSTER.md:48]
-
Which panel type shows a 0 or 1 gauge for many series?: A state timeline with a value mapping for 0 and for 1. The project already uses that form for the AI gateway health and the upstream status. (best practice) [sources: k8s/monitoring/dashboards/system-topology.json:823, k8s/monitoring/dashboards/system-topology.json:837, openspec/changes/archive/2026-11-14-5736-stat-timeline-status-topology-panels/design.md:9]
- Rejected: time series. It draws 6 to 23 sawtooth lines on an axis of 0 and 1.
- Chosen: state timeline with value mappings. It gives one row for each series and a name for each of the two values.
-
Which query and unit show a rate for each hour on panels 36, 40, 45 and 46?: rate(counter{...}[$__rate_interval]) times 3600, unit /h, with min 0. The rate follows the step of the panel, and the unit names the scale. (best practice) [sources: k8s/devops/dashboards/roadmap-service-telemetry.json:80, k8s/devops/dashboards/roadmap-service-telemetry.json:88, k8s/devops/dashboards/roadmap-service-telemetry.json:269, k8s/devops/dashboards/roadmap-service-telemetry.json:494, k8s/devops/dashboards/roadmap-service-telemetry.json:539, docs/DESIGN.md:233]
- Rejected: fixed 1 h window with unit short. The window does not follow the step of the panel, and the unit hides the scale.
- Chosen: rate over $__rate_interval times 3600 with unit /h. It gives the rate of each hour and names the unit.
-
How do panels 50, 51, 52 and 34 stop putting two units on one axis?: Panels 50 and 51 become bar gauges of the last value over $__range, one unit each. Panel 52 splits into a panel of the average searches per check and a panel of the number of checks, one unit each. Panel 34 splits into a bar gauge of calls and a table of the mean answer size in characters, one unit each. (best practice) [sources: docs/DESIGN.md:219, docs/DESIGN.md:233, k8s/devops/dashboards/roadmap-service-telemetry.json:859, k8s/devops/dashboards/roadmap-service-telemetry.json:904, k8s/devops/dashboards/roadmap-service-telemetry.json:949, k8s/devops/dashboards/devops-ai-rag.json:866, docs/TELEMETRY.md:145]
- Rejected: keep the average and the count on one axis. One axis cannot show a ratio and a count with one unit, and docs/DESIGN.md C1 forbids two y-axes.
- Chosen: bar gauges over $__range, and two panels for 52 and 34. Each panel then holds one unit and one measure.
-
Which panel opens each section with its error ratio?: A time series in percentunit from 0, with the guard (errors or total * 0) / total. The Roadmap Service row opens with the share of failed rounds of devops_cli_service_jobs_total (result="error") and the share of rejected webhook deliveries of devops_cli_service_webhook_deliveries_total (outcome="rejected"). (best practice) [sources: docs/DESIGN.md:233, tests/fixtures/dashboard_queries/devops-cli.yaml:43, k8s/devops/dashboards/roadmap-service-telemetry.json:46, docs/CLUSTER.md:109]
- Rejected: a stat of the share. It shows one value, not the share over time.
- Chosen: a time series in percentunit from 0 with the guard. It shows the share over time and shows 0 where no error series exists.
-
How do panels 44, 48 and 53 show 0 in place of no data?: Each becomes a stat panel whose query ends with or vector(0), so an absent series gives one sample of value 0. (best practice) [sources: tests/prometheus/test_k8s_monitoring_dashboards.py:729, k8s/devops/dashboards/roadmap-service-telemetry.json:442, k8s/devops/dashboards/roadmap-service-telemetry.json:622, k8s/devops/dashboards/roadmap-service-telemetry.json:667]
- Rejected: leave the query as it is. An absent series draws no data or a flat 0.
- Chosen: stat with or vector(0). The panel shows 0 where the series is absent, and the fix(monitoring): make the GitHub and command panels readable #4707 lint allows or vector(0) only in a stat.
-
Does this change set colors or panel types beyond the default?: No. The change keeps the palette-classic default and the built-in panel types, and leaves colors and the type system to the project design study. The owner scope is queries, panel types, units, legends and defaults only. (best practice) [sources: k8s/devops/dashboards/roadmap-service-telemetry.json:58, docs/DESIGN.md:225, docs/DESIGN.md:232]
- Rejected: set the colors in this change. The scope of the item holds queries, panel types, units, legends and defaults only; the design study owns the colors and the type.
- Chosen: keep the palette-classic default. Every panel of the two dashboards already uses the Grafana default palette, and docs/DESIGN.md C7 owns the color order.
- What does the fix(monitoring): make the GitHub and command panels readable #4707 readability lint require of each panel?: A description; a title with ': ' that names the signal and the measure; one unit and one y axis in a panel that is not a table; no count on a duration axis; or vector(0) only in a stat; and a time series window of $__interval or $__rate_interval with no line for each command. [sources: tests/prometheus/test_k8s_monitoring_dashboards.py:706, tests/prometheus/test_k8s_monitoring_dashboards.py:729, tests/prometheus/test_k8s_monitoring_dashboards.py:731]
- Which tests pin the current queries and must change with the panels?: tests/grafana/test_grafana_dashboards.py:1039 pins the Roadmap Service row's queries, tests/telemetry/test_telemetry_instruments.py:1641 pins the Planner Tool panel's two queries and grid position, and tests/prometheus/test_k8s_monitoring_dashboards.py:756 runs the fix(monitoring): make the GitHub and command panels readable #4707 readability lint over devops-cli.json only. The change updates them to read the two product dashboards and the new queries. [sources: tests/grafana/test_grafana_dashboards.py:1039, tests/telemetry/test_telemetry_instruments.py:1641, tests/prometheus/test_k8s_monitoring_dashboards.py:756, tests/prometheus/test_k8s_monitoring_dashboards.py:632]
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.
fixprefix of the title gives the type.(monitoring)scope of the title gives the scope.Operator-facing readability fix with no outage or data loss, but it blocks correct spend and duration reading.Operators cannot trust or read the Service row panels in their current state.Eighteen panels need new types, queries, units and legends, plus test fixtures, but no new code.Both change devops-cli.json panels, but #2703 hides empty sub-command panels while this fixes Service row panel types, queries and units.dan-petty commentedon Nov 12, 2026
Owner direction, 2026-11-12. Apply to the Service row the 4 rules that the #4707 comment adds:
percentunitfrom 0: Service rounds (result="error"divided by all rounds ofdevops_cli_service_jobs_total) and webhook deliveries (failed divided by all deliveries).fix(monitoring): make the GitHub and command panels readable (#5194)
dan-petty commentedon Nov 13, 2026
Input from #5553 (PR #5563): when that change is released, each row of the due table is a lane of its own. So the Service has 13 lanes for each repository, not 3. The panels that group by
lanethen draw more series:max by (repo, lane)ofdevops_cli_service_job_start_timestamp_seconds): 13 x 7 = 91 lines, not 21.The value of
laneis now the name of the row unlessservice.lanesgroups rows, sorowandlanehold the same values by default. Please include these panels when this item applies the readability rules (top 3 and "Other", or a sorted table).devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches turned up no open tool or library that retypes, requeries or relints Grafana dashboard panels; the only relevant hit is Grafana itself, whose built-in panel types (bar chart, bar gauge, state timeline, stat, table) are what the item already plans to use. The work is editing the project's own k8s/monitoring/dashboards/devops-cli.json and its query fixtures with those built-in panels, and the item explicitly asks for no new code, so there is nothing to adopt.
Tool: none found
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at cd3e0f9 (see proposed design in issue body).
devops-cli-service commentedon Nov 18, 2026
Released in v0.179.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.179.1
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 23:12 UTC