Skip to content

fix(grafana): resolve dashboard query failures and display issues#91

Merged
paveg merged 1 commit intomainfrom
fix/grafana-dashboard-improvements
Mar 22, 2026
Merged

fix(grafana): resolve dashboard query failures and display issues#91
paveg merged 1 commit intomainfrom
fix/grafana-dashboard-improvements

Conversation

@paveg
Copy link
Owner

@paveg paveg commented Mar 22, 2026

Summary

  • Fix Loki 30d query range limit errors by replacing $__range with $__auto + client-side calcs: sum for stat/pie panels
  • Fix API Duration legend explosion (hundreds of entries → 2 lines: avg, p95) by wrapping with proper aggregations
  • Change Tool Frequency/Success Rate from barchart to bargauge for proper Loki instant query rendering
  • Add queryType: instant to table panels (Token Usage by Model, Tool Duration, Session Analysis) to eliminate timestamp row repetition
  • Fix column rename mappings, add pagination to Session tables, adjust Activity Over Time bar settings
  • Add vite-plus env sourcing to zshrc

Test plan

  • just test passes (lint + format)
  • Dashboard deployed to Grafana Cloud and verified
  • Last 7 days view: all panels display data correctly
  • Last 30 days view: all panels display data correctly (no more query range errors)
  • API Duration legend shows exactly 2 entries (avg, p95)
  • Token Usage by Model table shows one row per model, no timestamp repetition
  • Session Analysis tables show reasonable page counts with pagination

🤖 Generated with Claude Code

Fix multiple issues in the Claude Code Cost & Efficiency dashboard:
- Replace $__range with $__auto + calcs:sum for stat/pie panels to avoid
  Loki 30d query range limit errors
- Fix API Duration legend explosion by wrapping aggregations
  (sum/count for avg, max for p95)
- Change Tool Frequency/Success Rate from barchart to bargauge for
  proper Loki data rendering
- Add queryType:instant to table panels (Token Usage, Tool Duration,
  Session Analysis) to eliminate timestamp row repetition
- Fix column rename mappings to match instant query output format
- Add pagination to Session Analysis tables
- Add interval and barWidthFactor to Activity Over Time
- Add vite-plus env sourcing to zshrc

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@paveg paveg merged commit 9266409 into main Mar 22, 2026
10 checks passed
@paveg paveg deleted the fix/grafana-dashboard-improvements branch March 22, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant