|
| 1 | +# Grafana dashboards |
| 2 | + |
| 3 | +## `panurus.json` — Panurus Overview |
| 4 | + |
| 5 | +A single overview dashboard covering every metric Panurus exports: 20 panels across 9 rows, one row per |
| 6 | +subsystem (driver services, transaction lifecycle, finality listener, envelope sessions, auditor, token |
| 7 | +selection, certification and identity caches, signer resolution and cache provisioning, Fabric-X finality |
| 8 | +queue). |
| 9 | + |
| 10 | +### Import |
| 11 | + |
| 12 | +1. Grafana → **Dashboards** → **New** → **Import** → *Upload JSON file*. |
| 13 | +2. Pick the Prometheus data source that scrapes the node's metrics endpoint when prompted for |
| 14 | + `DS_PROMETHEUS`. |
| 15 | + |
| 16 | +The dashboard declares four template variables — `network`, `channel`, `namespace` and `method` — whose |
| 17 | +values are discovered with `label_values` against |
| 18 | +`panurus_core_common_metrics_transfer_service_operations_total`. A node that has never issued or |
| 19 | +transferred a token exports no series for that metric, so the pickers stay empty until the first |
| 20 | +transaction; the unfiltered panels still work. |
| 21 | + |
| 22 | +Requires Grafana 9.0 or later (`schemaVersion` 37). |
| 23 | + |
| 24 | +### Not covered |
| 25 | + |
| 26 | +- **FSC platform metrics** (views, sessions, gRPC, process) — these come from |
| 27 | + [Fabric Smart Client](https://github.com/hyperledger-labs/fabric-smart-client/blob/main/docs/platform/view/services/monitoring.md) |
| 28 | + and are exported under `fsc_*`, not `panurus_*`. |
| 29 | +- **Traces.** The dashboard is metrics-only. |
| 30 | +- Panels are built from metric *names*, so they show what a node reports, not whether the reported |
| 31 | + numbers are healthy: there are no thresholds or alert rules here. |
| 32 | + |
| 33 | +### Changing it |
| 34 | + |
| 35 | +Every query in this file is checked by `token/services/metricsdoc`, which asserts that |
| 36 | + |
| 37 | +- each metric a query names is one the SDK registers, under the name Prometheus actually exports; |
| 38 | +- each metric name carries its package prefix, so a bare `Name` from the Go source fails the build |
| 39 | + rather than rendering an empty panel; |
| 40 | +- each label a query filters or groups on is declared by the metric it is applied to; |
| 41 | +- each `$variable` a query interpolates is either a Grafana built-in or declared in this dashboard. |
| 42 | + |
| 43 | +These are the failure modes a dashboard cannot report itself: Grafana does not error on an unknown |
| 44 | +metric or an absent label, it renders **No data**, which is indistinguishable from an idle node. An |
| 45 | +earlier version of this dashboard ([#1749](https://github.com/LFDT-Panurus/panurus/pull/1749)) had every |
| 46 | +one of its 51 panel queries and 4 variable queries written against bare option names from the Go source, |
| 47 | +so not one of them matched a series; it closed unmerged. |
| 48 | + |
| 49 | +So: after editing a query, run |
| 50 | + |
| 51 | +```bash |
| 52 | +go test ./token/services/metricsdoc/... |
| 53 | +``` |
| 54 | + |
| 55 | +If you add a panel for a metric that does not exist yet, add the metric first — see |
| 56 | +[Metrics Reference](../../development/metrics.md) for the exported names and |
| 57 | +[`testdata/metrics.golden`](../../../token/services/metricsdoc/testdata/metrics.golden) for the |
| 58 | +machine-readable list. |
0 commit comments