From 114f6c2ce7cd3904065d043ba95b5f94df4e0847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Tue, 9 Jun 2026 11:52:10 +0200 Subject: [PATCH] fix(infra): raise Prometheus retention.size 1GB -> 6GB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prometheus size-based retention counts the WAL toward its budget. With retention.size=1GB and a stuck/corrupt WAL that had grown to 2.1GB, the total was permanently over budget, so Prometheus deleted every freshly-compacted block the moment it was written. Net effect: only the in-memory ~2h head block was ever queryable — metrics appeared to "start this morning" no matter when you looked, and last night's Caddy 502 spike (planner /api/overpass upstream stall, 18:33-18:34 UTC) was unobservable in Prometheus (logs survived in Loki). The corrupt WAL was cleared out-of-band on the flagship. This raises the size backstop to 6GB so compacted blocks survive to the intended 15d time-based retention. Disk is 38G (43% used), so 6GB is safe headroom. Co-Authored-By: Claude Opus 4.8 (1M context) --- infrastructure/docker-compose.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/infrastructure/docker-compose.yml b/infrastructure/docker-compose.yml index 1a7c623..9cd36dc 100644 --- a/infrastructure/docker-compose.yml +++ b/infrastructure/docker-compose.yml @@ -201,7 +201,13 @@ services: command: - "--config.file=/etc/prometheus/prometheus.yml" - "--storage.tsdb.retention.time=15d" - - "--storage.tsdb.retention.size=1GB" + # Size-based retention is a disk-safety backstop, not the primary + # policy (time=15d is). It counts the WAL toward the budget, so a + # too-small cap makes Prometheus delete freshly-compacted blocks on + # creation — which it did at 1GB, leaving only the ~2h head block + # queryable (a stuck/corrupt WAL had bloated to 2.1GB). 6GB holds + # ~15d of metrics at current cardinality with headroom; disk is 38G. + - "--storage.tsdb.retention.size=6GB" loki: image: grafana/loki:latest