feat: add structured JSON logging and metrics collection #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/10-monitoring-logging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds production-ready monitoring infrastructure to pixel-clash.
New files
server/logger.js— Structured JSON logger (debug/info/warn/error), child context, LOG_LEVEL env var, stderr for errorsserver/metrics.js— In-memory counters, gauges, histograms with snapshot APIserver/logger.test.js— 5 unit testsserver/metrics.test.js— 10 unit testsNew endpoints
GET /api/health— Liveness check (uptime, memory, ws clients, board status)GET /api/metrics— Full metrics snapshot (process info, all counters/gauges/histograms)Changes
console.logwith structuredlogger.info/warn/errorcallsboard.isLoaded()helperTest results
Closes #10