[Bug][Grafana/Dashboards] Missing PostgreSQL dashboards and panel desync for Cursor and AI metrics
Search before asking
- [x] I had searched in the issues and found no similar issues.
What happened
DevLake officially supports both MySQL and PostgreSQL as lake databases. In PR #8870, dashboards were split into grafana/dashboards/mysql/ and grafana/dashboards/postgresql/, and Grafana provisioning selectively mounts or keeps the relevant database directory based on DATABASE_TYPE.
However, the recent Cursor integration (PR #9017) and Claude Code integration (PR #8808) introduced significant dashboard omissions and desyncs for PostgreSQL deployments:
- cursor-usage.json is completely missing from PostgreSQL: • cursor-usage.json was added in PR #9017 (1,354 lines of JSON). • No PostgreSQL equivalent was created in . • When running on PostgreSQL, entrypoint.sh:66 executes rm - rf /etc/grafana/dashboards/mysql, and docker-compose-dev- postgresql.yml mounts only ./grafana/dashboards/postgresql. As a result, Cursor users on PostgreSQL have no Cursor dashboard at all.
- Panels are out-of-sync in existing comparison dashboards: • ai-cost-efficiency.json: The MySQL version has 17 panels, while the PostgreSQL version has only 10 panels. All 7 Cursor panels (such as Cursor Spend Breakdown, Charged Amount, and spend reconciliation) are completely missing from PostgreSQL. • multi-ai-comparison.json: The MySQL version has 10 panels, while the PostgreSQL version has only 9 panels. The Cursor: Tab Completions panel and Cursor LOC/acceptance queries are missing from PostgreSQL.
- Claude Code dashboards stranded in root directory: • ClaudeCodeAdoption.json and ClaudeCodeAdoptionByUser.json sit directly in grafana/dashboards/ root hardcoded to "datasource": {"type": "mysql", "uid": "devlake-mysql-api"} and MySQL-specific functions (TIMESTAMPDIFF, DATE_SUB). • Because docker-compose-dev-mysql.yml and docker-compose- dev-postgresql.yml mount grafana/dashboards/mysql and grafana/dashboards/postgresql directly to /etc/grafana/dashboards:ro, files in the root folder are not mounted in local dev environments and fail with missing datasource errors in PostgreSQL containers.
What do you expect to happen
-
Full PostgreSQL Parity for Cursor: • Generate cursor-usage.json with converted PostgreSQL SQL syntax (DATE_TRUNC, TO_CHAR, COALESCE, interval arithmetic) and UID cursor_usage-pg. • Ensure datasource references match Grafana 13 format: "datasource": {"type": "grafana-postgresql-datasource", "uid": "devlake-postgres-api"}
-
Synchronize Comparison Dashboards: • Sync ai-cost-efficiency.json to include the 7 missing Cursor spend panels with PostgreSQL syntax. • Sync multi-ai-comparison.json with Cursor Tab Completions and LOC/acceptance queries.
-
Move & Convert Claude Code Dashboards: • Move ClaudeCodeAdoption.json and ClaudeCodeAdoptionByUser. json into grafana/dashboards/mysql/. • Generate their PostgreSQL equivalents in grafana/dashboards/postgresql/.
How to reproduce
-
Start DevLake using PostgreSQL: docker-compose -f docker-compose-dev-postgresql.yml up postgres grafana
-
Log into Grafana (http://localhost:3002 or http://localhost:4000/grafana).
-
Search for dashboards: • Notice that Cursor Usage is missing. • Open AI Cost-Efficiency: notice that Cursor spend panels are missing (only 10 panels instead of 17). • Open Multi-AI Tool Comparison: notice Cursor metrics are missing.
Anything else
• Root Cause: PR #9017 added the Cursor plugin and updated MySQL dashboards, but did not run convert-mysql-to-postgresql.py or generate PostgreSQL dashboards. CI currently does not test dashboard parity between MySQL and PostgreSQL. • Relevant files: • cursor-usage.json • ai-cost-efficiency.json vs ai-cost-efficiency.json • multi-ai-comparison.json vs multi-ai-comparison.json • convert-mysql-to-postgresql.py
Version
main (commit a18194b96b5b332a60a74b23d51bacbb4262234d)
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Thanks for your contribution.