From 46d569720cf25694252cc4747f509c151127645e Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Mon, 22 Jun 2026 21:35:48 +0200 Subject: [PATCH] fix(grafana): give "Database size" stat real byte thresholds The "Database size" stat had no thresholds, so Grafana applied its stat default (green base, red at >=80). The query is pg_database_size_bytes, so a healthy ~9 MiB database (9.4M >> 80) rendered permanently RED on the Scrabble - Resources dashboard (test + prod), reading as a false alert; the neighbouring percentunit cache-hit stat stayed green only because its 0..1 values fall under 80. Add absolute byte thresholds sized to the 40 GiB prod disk (4.6 GiB used, observability bounded -- Tempo <=1 GiB, Prometheus 7d -- so the DB is the only unbounded grower): green up to 8 GiB, yellow at 8 GiB (~20% of disk), red at 16 GiB (~40%), an early warning with ample runway before the disk tightens, not a panic line. Cosmetic panel coloring only; there are no Grafana alert rules provisioned. --- deploy/grafana/dashboards/resources.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/deploy/grafana/dashboards/resources.json b/deploy/grafana/dashboards/resources.json index a1d503e..663298d 100644 --- a/deploy/grafana/dashboards/resources.json +++ b/deploy/grafana/dashboards/resources.json @@ -36,7 +36,21 @@ "type": "stat", "title": "Database size", "gridPos": { "h": 5, "w": 6, "x": 18, "y": 0 }, - "fieldConfig": { "defaults": { "unit": "bytes" }, "overrides": [] }, + "fieldConfig": { + "defaults": { + "unit": "bytes", + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "yellow", "value": 8589934592 }, + { "color": "red", "value": 17179869184 } + ] + } + }, + "overrides": [] + }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "targets": [{ "refId": "A", "expr": "max(pg_database_size_bytes{datname=\"scrabble\"})" }] }, -- 2.52.0