Dashboard for viewing system and business metrics with Prometheus / OpenTelemetry compatibility and PII-safe display.
/dashboardlib/metrics/panels.ts./api/v1/query_range)Set one of these server-side environment variables (do not use NEXT_PUBLIC_):
METRICS_PROMETHEUS_BASE_URL=http://localhost:9090
# or
METRICS_OTEL_PROMETHEUS_BASE_URL=http://localhost:9464
If neither is set, the dashboard uses mock metrics so the UI works out-of-the-box.
This dashboard is defense-in-depth:
lib/metrics/sanitize.ts:
email, user_id, instance, ip, wallet, etc.)seriesName (built from sanitized labels).Important: Frontend sanitization is not a substitute for server-side governance. Ensure your metrics pipeline never emits PII.
Edit lib/metrics/panels.ts and add a new entry:
id: stable identifiergroup: system or businesstitle / descriptionpromqlRange: a safe PromQL queryPanels are predefined to avoid arbitrary PromQL execution from browsers.
| Criterion | Implementation |
|---|---|
| All major metrics are visualized | System + business panel groups in /dashboard |
| No PII in any metric | Label sanitizer + UI only renders sanitized series names |
| Export and filtering work | Series name filter + CSV export |
| Documentation complete | This document |