diff --git a/docker/telemetry/grafana/dashboards/node-health.json b/docker/telemetry/grafana/dashboards/node-health.json index 5fcde759cd..cf86b02c3f 100644 --- a/docker/telemetry/grafana/dashboards/node-health.json +++ b/docker/telemetry/grafana/dashboards/node-health.json @@ -3017,7 +3017,7 @@ "refId": "A" } ], - "title": "FullBelowCache Hit Rate", + "title": "FullBelowCache Hit Rate [$xrpl_network_type]", "type": "gauge" } ], diff --git a/docker/telemetry/grafana/dashboards/validate_dashboards.py b/docker/telemetry/grafana/dashboards/validate_dashboards.py index 07240e6e1c..27b8d36469 100755 --- a/docker/telemetry/grafana/dashboards/validate_dashboards.py +++ b/docker/telemetry/grafana/dashboards/validate_dashboards.py @@ -2,6 +2,7 @@ """Dashboard lint: cumulative metrics rate()-wrapped; tier filters; sane panel grid.""" import json, re, sys +from pathlib import Path GRID_COLUMNS = 24 @@ -164,8 +165,23 @@ def check(path, forbid_5m): def main(): + """Validate the dashboards named on the command line, or all of them. + + Exit status: 0 every dashboard passed, 1 violations were found, 2 there was + nothing to validate. The last is an error rather than a pass: reporting + success without having read a single dashboard is indistinguishable from a + clean run, so a caller that mis-spells a path gets a green light for work + that never happened. + """ args = [a for a in sys.argv[1:] if not a.startswith("--")] forbid_5m = "--no-5m" in sys.argv + if not args: + # Default to every dashboard beside this script, so a bare run checks + # the whole set instead of iterating an empty list. + args = sorted(str(p) for p in Path(__file__).resolve().parent.glob("*.json")) + if not args: + print("ERROR: no dashboard JSON files to validate", file=sys.stderr) + sys.exit(2) all_errs = [] for path in args: all_errs += check(path, forbid_5m)