docs(logging): audit source, corrected measurements, pitfalls and acceptance evidence

- audit log section: allowlist fields, the two-retention-policies note, and the
  05:52-05:58 UTC incident (stage.pack leaked _entry; fixed, purged by wiping
  the PVC and resetting positions).
- measurements: 7.0x compression on the fresh store; two regimes (quiet 360
  MB/day, osint crawl 3.2 GB/day raw) -> <=3.7 GiB over 192h against an 8Gi PVC.
- pitfalls that cost real time: alloy validate does not catch component build
  errors, stage.json is JMESPath, stage.pack keeps _entry, file source needs an
  explicit timestamp stage, alloy positions path permissions.
- acceptance evidence: the real 7-day lines, per-source retained depth (incl.
  the honest 5d9h pod-log ceiling) and the restart test.
- alert threshold: 200 kB/s (was 12 MiB/s, which was ~50x too lax to mean
  anything against an 8Gi PVC).
This commit is contained in:
Lance Walters 2026-11-27 01:06:11 -05:00
commit e307f9dfd2
2 changed files with 150 additions and 68 deletions

View file

@ -43,20 +43,22 @@ spec:
- name: logging-storage
rules:
- alert: LokiIngestRateAboveBudget
# ~1 GiB/day of *compressed* chunk data would blow the 8Gi bound
# before the compactor can keep up; the baseline is ~1% of this.
# 200 kB/s raw ~= 17 GB/day ~= 2 GB/day compressed, which fills the
# 8Gi PVC inside the 192h window. Measured baselines: 4 kB/s quiet,
# ~37 kB/s during an osint crawl (2026-11-27, see docs/logging.md),
# so this only fires on a real runaway (log loop, debug left on).
expr: |
sum(rate(loki_distributor_bytes_received_total[30m])) > 12 * 1024 * 1024
sum(rate(loki_distributor_bytes_received_total[30m])) > 200 * 1024
for: 1h
labels:
severity: warning
annotations:
summary: Loki ingest is above the storage budget
description: >-
Loki is receiving {{ $value | humanize1024 }}B/s (>12 MiB/s), which
is ~1 GiB/day of chunk data — more than the 8Gi PVC can hold for
192h. Either a workload started logging in a loop, or retention /
limits need revisiting before the disk does.
Loki is receiving {{ $value | humanize1024 }}B/s (>200 kB/s), which
is ~17 GB/day raw — enough to fill the 8Gi PVC before the 192h
retention can delete anything. Either a workload started logging in
a loop, or retention / limits need revisiting before the disk does.
- alert: LokiDown
expr: up{job="loki"} == 0
for: 10m