Week 060 — Grafana, Claude Code, and the Lost Radius Bug

The app gets observability. The development workflow gets an AI upgrade.

Week of January 12, 2026

Progress

Grafana, Loki, and Prometheus were containerized and connected to the application's log output. The key insight: logging to files means Loki has to tail a file; logging to stdout means Docker automatically surfaces it. PHP logging was reconfigured to write to stderr/stdout rather than files, making logs automatically visible to Loki without additional file-watching configuration.

A Grafana configuration bug ate most of Monday and Tuesday — the log mapping across three different config files (alloy config, observability compose, app compose) was hard to keep straight. There was also a MacOS/Docker-specific issue: file events on host-mounted volumes don't propagate into containers unless Docker Desktop's Virtuous FS option is enabled. Once that was changed, the file watching worked.

The lost radius bug was also found this week: the radius value wasn't being captured on save. It was reaching the UI but not making it into the POST payload.

Claude Code was subscribed to mid-week. The first task given to it: reformat api-item.php to 80-character max width with consistent tab indentation. Quick result, low risk. The tool is promising.

Decision Made

Always show the lost location map when an item has location data — no toggle or "show map" button. The map is the useful interface; hiding it behind a button adds friction without benefit.

Next Week

Grafana for production. Item API refactoring.