Skip to content

feat: Analytics Dashboard — Prometheus, Grafana + Admin UI (depends on #5)#7

Open
derpixler wants to merge 3 commits into
mainfrom
feat/analytics-dashboard
Open

feat: Analytics Dashboard — Prometheus, Grafana + Admin UI (depends on #5)#7
derpixler wants to merge 3 commits into
mainfrom
feat/analytics-dashboard

Conversation

@derpixler

Copy link
Copy Markdown
Owner

⚠️ Depends on #5 (token-usage-tracking)

This PR builds on the /admin/metrics endpoint and DB schema from #5. Merge #5 first.

What

Analytics stack for token usage visualization — Prometheus metrics, Grafana dashboard, and in-app admin analytics UI.

Changes

Prometheus (prometheus.yml) — scrapes /admin/metrics with admin token auth every 30s.

Grafana (grafana/) — pre-configured dashboard with:

  • Token consumption rate timeseries (by contributor)
  • Token totals bar gauge
  • LLM calls rate timeseries
  • LLM calls bar gauge
  • Contributor token summary table
  • Auto-refresh every 30s

docker-compose.yml — prometheus + grafana services (commented out by default, uncomment to enable).

  • Grafana on 127.0.0.1:3000 only (admin auth required)
  • Dashboard auto-provisioned via grafana/provisioning/

/admin/metrics endpoint extended — added raido_tokens_by_station and raido_tokens_by_role gauges with contributor+station and contributor+role labels.

Admin Analytics UI (hub/web/index.html) — new Token Analytics (Admin) section:

  • Overview list of all contributors with total tokens + calls
  • Click to see detail: summary stats, by-station breakdown, by-role breakdown, recent calls table
  • Auto-refreshes every 30s
  • Only visible with admin token

Security

  • All metrics/analytics behind admin token
  • Grafana bound to localhost only (SSH tunnel or NGINX proxy required)
  • Prometheus uses admin token in scrape authorization header

- prometheus.yml: scrape /admin/metrics with admin token auth
- grafana/dashboards/raido.json: pre-configured dashboard (token rate, totals, calls, by contributor)
- grafana/provisioning: auto-datasource + dashboard provider
- docker-compose.yml: prometheus + grafana services (commented, uncomment to enable)
- hub/app/main.py: extend /admin/metrics with by-station and by-role breakdowns
- hub/web/index.html: admin analytics section with per-contributor detail (summary, by station, by role, recent calls table)
- Analytics section auto-refreshes every 30s with other admin data
@gitguardian

gitguardian Bot commented Jun 14, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
33976717 Triggered Generic Password 8bd2cb0 docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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