Files
G0DM0D3/functions
faber 0fcc33f9eb fix: harden telemetry for 100k MAU — memory caps, IP rate limiting, size guards
P1 fixes:
- Per-request body capped at 512 KiB (was 24 MiB — would OOM Workers)
- Flush reads at most 50 keys capped at 5 MiB combined (was unbounded)
- Dual rate limiting: per-session + per-IP (blocks session_id rotation)
- Content-Length early reject before reading body into memory
- Chunked UTF-8 base64 encoding (avoids Array.from() on full payload)
- Max 100 events per batch (was 500)
- Rate limiter map eviction at 10k entries (prevents isolate memory leak)
- Direct-commit fallback warns loudly when TELEMETRY_KV not bound
- Deployment checklist in header comment (WAF, IP rate limit, KV plan)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-10 21:22:04 -04:00
..