feat(miner): add a Grafana dashboard for coding-agent-driver usage, cost, and attempt outcomes - #5646
Conversation
…ost, and attempt outcomes Adds grafana/dashboards/miner-usage.json: a single dashboard (a $provider template variable, not one dashboard per provider) showing per-provider attempt success/fail counts, total cost, and total tokens, reading only the redacted attempt_outcome_summary rows the AMS reporting export exposes via the AMS Attempt Log SQLite datasource -- no Prometheus scraping. Cross-references ai-usage.json (ORB) in both directions via a top-level `links` entry, matching the only existing dashboard-to- dashboard link convention in this repo (resource-hub.json's own links array). ai-usage.json's other panels/variables are untouched.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5646 +/- ##
=======================================
Coverage 95.03% 95.03%
=======================================
Files 577 577
Lines 45920 45920
Branches 14695 14695
=======================================
Hits 43640 43640
Misses 1528 1528
Partials 752 752
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-13 19:28:55 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Depends on #5637 (merged) for the
provider/cost_usd/tokens_usedcolumns this dashboard reads.grafana/dashboards/miner-usage.json: per-provider (claude-cli/codex-cli/agent-sdk) attempt success/fail counts, total cost, and total tokens, all in one dashboard behind a$providertemplate variable — not one dashboard per provider, per the issue's own reasoning (AMS's local ledger has far lower data volume than ORB's three cloud reviewers).AMS Attempt LogSQLite datasource'sattempt_outcome_summaryrows only (event_type = 'attempt_outcome_summary') — never Prometheus, never the live ledger.ai-usage.json(ORB) in both directions via a top-levellinksentry — the only existing dashboard-to-dashboard link convention already in this repo (resource-hub.json's ownlinksarray).ai-usage.json's other panels/variables/datasources are untouched.tokens_usedreads0/NULLhonestly today (documented on the panel itself) — no coding-agent driver reports real token usage yet (Decide fate of attempt-metering.ts: wire real per-attempt budget enforcement, or remove it #5395); the dashboard needs no changes once one does.Test plan
npm run selfhost:validate-observability(repo's own dashboard-JSON structural validator)test/unit/selfhost-grafana-miner-usage-dashboard.test.ts(9 cases), mirroringselfhost-grafana-ai-usage-dashboard.test.ts's real-sqlite3-execution rigor: structural checks (uid/title/tags, single$providervariable, SQLite-only datasource, cross-reference links both directions, additive-onlyai-usage.jsondiff), an invariant test asserting no panel ever mixes AMS'sattempt_log_eventstable with ORB'sai_usage_events/Prometheus metric names, and a seeded-database test that runs every panel's actual query and verifies$providernarrows correctly (including that a non-attempt_outcome_summaryrow on the sameattempt_id, withprovider IS NULL, never leaks into any aggregate or the recent-outcomes table)npm run typecheckgit diff --checkCloses #5185