Sometimes you want a quick diagnostic without wiring a full metrics stack. expvar exposes variables at /debug/vars in a standard JSON format. I use it for a handful of counters like “requeststotal” and “jobsfailed” when I’m bootstrapping a service or debugging in a constrained environment. The important point is to keep variables low cardinality and avoid storing user data. Because expvar is global, I treat it as a debug interface: expose it only on an internal listener or behind auth. In production, Prometheus is usually better, but expvar is surprisingly useful for ad-hoc checks during incident response. It’s also nearly zero setup: define variables, increment them, and register the handler. This snippet shows a simple counter you can bump from handlers and jobs.