Skip to content

Commit e43eaa1

Browse files
committed
feat(grafana): refresh Cursor usage dashboard
* Align cost panels with currencyUSD and stacked daily on-demand versus included spend. * Document Enterprise AI Code Tracking gaps in the cursor plugin README. Signed-off-by: Joshua Smith <jbsmith7741@gmail.com>
1 parent 1759930 commit e43eaa1

2 files changed

Lines changed: 782 additions & 198 deletions

File tree

backend/plugins/cursor/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Grafana dashboard JSON lives under `grafana/dashboards/mysql/`:
135135
| AI Cost Efficiency (Cursor panels) | `ai-cost-efficiency.json` ||
136136
| Multi-AI Comparison (Cursor panels) | `multi-ai-comparison.json` ||
137137

138-
See `grafana/dashboards/mysql/CursorREADME.md` for dashboard prerequisites, variables, and panel descriptions.
138+
See `grafana/dashboards/mysql/cursor-usage.json` for the dashboard definition and [rak_tools/grafana.md](../../../rak_tools/grafana.md) for currency formatting and Grafana version notes.
139139

140140
## Error handling
141141

@@ -149,9 +149,30 @@ See `grafana/dashboards/mysql/CursorREADME.md` for dashboard prerequisites, vari
149149

150150
Tokens are sanitized before persisting. Connection test results include a `permissions` object showing which Admin API endpoints succeeded.
151151

152+
## Not collected (Enterprise AI Code Tracking)
153+
154+
The following endpoints from the [AI Code Tracking API](https://cursor.com/docs/account/teams/ai-code-tracking-api) are **Enterprise plan only** and are **not implemented** in this plugin (no collector, extractor, or `_tool_cursor_*` table):
155+
156+
| Endpoint | Purpose |
157+
|----------|---------|
158+
| `GET /analytics/ai-code/commits` | Per-commit AI line attribution (TAB vs Composer vs non-AI) |
159+
| `GET /analytics/ai-code/changes` | Granular accepted AI changes |
160+
| `GET /analytics/ai-code/commits.csv` / `changes.csv` | Bulk CSV exports of the above |
161+
162+
Team/Business Admin API keys typically receive **401** on these routes. Connection test optionally probes `GET /analytics/team/dau` (`probeEnterpriseAnalytics`) to detect Enterprise access; it does **not** ingest analytics data.
163+
164+
**Metrics this would unlock** (shown on the Cursor native dashboard but absent from DevLake today):
165+
166+
- AI share of **committed** code (not editor line acceptance)
167+
- Per-commit `commitSource`: IDE, CLI, or cloud
168+
- Repo name and primary-branch filters
169+
- TAB vs Composer line attribution on commits
170+
171+
The **Cursor Usage** Grafana dashboard (`grafana/dashboards/mysql/cursor-usage.json`) uses Admin API proxies from `_tool_cursor_daily_usage` and `_tool_cursor_usage_events` instead; panel descriptions note where metrics are approximate.
172+
152173
## Limitations
153174

154-
- **Team/Business Admin API only** — Enterprise-only Analytics API endpoints (`/analytics/*`) are not collected in this plugin.
175+
- **Team/Business Admin API only** — Enterprise-only Analytics API endpoints (`/analytics/*`) are not collected in this plugin (see [Not collected (Enterprise AI Code Tracking)](#not-collected-enterprise-ai-code-tracking) above).
155176
- **Tool layer only** — no domain-layer tables; cross-plugin joins (Jira, GitHub PRs, etc.) are done in Grafana SQL or separate tooling.
156177
- **Team-level scope** — one scope per connection represents the whole team; per-team multi-tenant collection is not supported.
157178
- **Beta** — the plugin is marked beta in Config UI while the Admin API surface continues to evolve.

0 commit comments

Comments
 (0)