Repository navigation
Closed
Labels
Description
What happened
The Grafana dashboard "AI Spend and LLM Usage Telemetry" (k8s/monitoring/dashboards/ai-spend.json, uid ai-spend-telemetry) shows $0 local savings for 2026-10-01 to 2026-10-21, while Prometheus holds the tokens and devops ai cost prices them. Read on 2026-10-24:
- Prometheus,
sum by (local, provider, server, operation, type) (increase(devops_cli_ai_tokens_total[21d]))at 2026-10-22T00:00Z: providergateway, serverai.<domain>(the workstation) 136.08 M prompt and 5.31 M completion tokens; serverllm-gateway.llm.svc.cluster.local:4000(in-cluster jobs) 6.80 M and 1.27 M. These series have nolocaland nooperationlabel: fix(ai): local savings use one reference price per request kind for every process, and an unknown model or reference warns instead of pricing at $0 #1672 (2026-10-23/24) added both. Every savings panel selectslocal="true"and joinson (operation, type), so nothing before fix(ai): local savings use one reference price per request kind for every process, and an unknown model or reference warns instead of pricing at $0 #1672 matches. - The recording rule
devops_cli:ai_reference_price_usd_per_token(k8s/monitoring/prometheus-values.yaml:609-635) is loaded and healthy, but it has series only since the rule file changed on 2026-10-24 ~20:22 UTC (count(...)is 0 on every day before). A stat panel over a range that ends before that has no price to multiply by. - The rule prices at
gpt-4o-mini($0.15 / $0.60 per million), the repository default (DEFAULT_AI_REFERENCE_MODEL). The owner'sconfig.yamlsetsai.reference_model: gpt-4o($2.50 / $10 per million), whichdevops ai cost reportuses: $402.75 for the same weeks from the workstation ledger. At gpt-4o the Prometheus tokens give $423.03 (workstation $393.33, in-cluster $29.69); at gpt-4o-mini $25.38.
What should happen
The savings panels show the local savings of any range in Prometheus' retention, priced at one reference model that the CLI report also uses:
- The reference model is the owner's choice,
gpt-4o: the repository defaultDEFAULT_AI_REFERENCE_MODEL, the price that the dashboard multiplies by, anddevops ai costagree, and the existing test that checks prices against genai-prices checks all of them. - A range that ends before the price series existed is priced too (for example, the price is a constant in the panel query that the same test checks, instead of a join on a recording rule that exists only from its first evaluation). Record the choice in the design.
- Series from before fix(ai): local savings use one reference price per request kind for every process, and an unknown model or reference warns instead of pricing at $0 #1672 (no
local, nooperationlabel) are counted:operationabsent meanschat, and a series of providergatewaywithoutlocalis local, because the gateway config serves only local Ollama tiers (checkk8s/llm/gateway/config.yamland say so in the design). This mapping can go when those series leave the retention window; the design says when.
Acceptance criteria
- A test over the dashboard JSON and the rule file fails when the dashboard's price differs from genai-prices at
DEFAULT_AI_REFERENCE_MODEL, or whenDEFAULT_AI_REFERENCE_MODELis notgpt-4o. - A test (promtool, as the other rule tests do, or a query test on recorded series) shows that the "Local Cloud Savings in Range" panel gives the priced total for series with and without the
localandoperationlabels, and for a range that ends before the price rule's first sample. - After the merge, the panel over 2026-10-01 to 2026-10-21 shows about $423 (a person checks it in Grafana).
Source: #1672
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate describes a bug in the AI spend dashboard where incorrect pricing leads to wrong savings values.The dashboard shows incorrect financial data affecting decision making.Correct financial reporting is essential for resource planning and cost control.Fixing the dashboard requires understanding of Prometheus queries, recording rules, and Grafana panel configurations.