Repository navigation
Open
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard workscope/monitoringGrafana, Prometheus, Loki, alerts and dashboardssource/agentFiled by an agentstatus/newStatus New: the item is not ready yettype/bugType bug: the code does not do what it mustvalue/mediumValue Medium
Description
Update 2026-11-26 (infra move): tests/prometheus/test_k8s_monitoring_dashboards.py is gone (#7234). The dashboard cases run in tests/prometheus/test_dashboard_queries.py.
Split from #4724. The pull request of #4724 changes only the spend panels of k8s/devops/dashboards/ai-spend.json. These parts of #4724 stay open:
Problem
- Token Processing Rate (tokens/sec) and Request Rate by Model use
rate(...[5m])on the sparse OTLP countersdevops_cli_ai_tokens_totalanddevops_cli_ai_requests_total. A Job pod sends about 6 samples for each series in 6 h, so a 5 min window holds 0 or 1 sample. At 7 d the panels show 37 % of the requests and 42 % of the tokens (measure of fix(monitoring): read AI spend from the gateway counter #4724). Their rolling lines use fixed[30m]windows. - Response Cache Hit Share, Gateway Attempts by Status and Gateway Requests and Tokens by Caller use rolling
[1h]windows at steps under 1 h, so the points overlap. - Ollama Slot Wait by Priority (p95) has no series in 30 d (query of 2026-11-16:
count by (priority, outcome) (last_over_time(devops_cli_ai_ollama_slot_wait_seconds[30d]))is empty). k8s/devops/dashboards/devops-ai-rag.jsonhas the same spend defect: AI Spend in Range and AI Spend Rate by Server ($/hr) readdevops_cli_ai_spend_usd_totalwithrate(...[5m]).
Expected behavior
- The request and token panels draw bars per hour with
increase(...[$__interval])and a Min interval of 1h. A call through the gateway comes from the gateway series (litellm_proxy_total_requests_metric_total,litellm_total_tokens_metric_total), as AI Requests in Range and Tokens Processed in Range do (feat(monitoring): the ai-spend dashboard counts gateway traffic from the gateway's own series, shows failed attempts and names each caller #1668). - Each time series window follows the step (
$__intervalor$__rate_interval). - The slot-wait panel shows a series that the client sends, or the dashboard removes it.
openspec/specs/llm-slot-wait/spec.mdchanges with it. - The spend panels of
devops-ai-rag.jsonread the gateway spend counterlitellm_spend_metric_total, as the spend panels ofai-spend.jsondo after fix(monitoring): read AI spend from the gateway counter #4724.
Acceptance criteria
tests/fixtures/dashboard_queries/ai-spend.yamlholds a bars case for the request and token panels, and the bars add up to the fixture total within 1 %.- Live at 7 d: the request bars add up to at least 95 % of
sum(increase(devops_cli_ai_requests_total[7d])). tests/prometheus/test_dashboard_queries.pypasses.
Source: #4724
Alternatives check of 2026-11-24: none.
Tool: none found.
Reason: Searches found only PromQL linters and dashboard generators; none rewrites panel queries or handles sparse counters, so the fix stays in the dashboard JSON with increase(...[$__interval]), a 1 h Min step and the repo's fixture test.
Lacks:
- No tool rewrites rate() windows inside panel JSON
- No handling of counters with one sample per hour
- No switch to gateway series or drop of slot-wait panel
- No fixture test that bar totals add up
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard workscope/monitoringGrafana, Prometheus, Loki, alerts and dashboardssource/agentFiled by an agentstatus/newStatus New: the item is not ready yettype/bugType bug: the code does not do what it mustvalue/mediumValue Medium
Activity
dan-petty commentedon Nov 16, 2026
Both fix fixed time windows in monitoring dashboards, but #4732 targets llm-stack.json while the candidate targets ai-spend.json and devops-ai-rag.json.fix(monitoring): read AI spend from the gateway counter (#5924)
devops-cli-service commentedon Nov 17, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 24, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/grafana/dashboard-linter. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources: