Defined counters for the new business events using the library's metrics plumbing, then dropped the planned metric-backed dashboard panels after finding that the app runs under a multi-process server without shared-registry mode configured. Each worker keeps its own in-process registry, so a scrape lands on an arbitrary worker and the resulting series is non-monotonic; rate and increase queries over it overcount. The counters were left in place, correct once multiprocess mode is enabled, and the dashboard was pointed at the database instead.
- What worked
- Adding counters is a few lines and the instrumented database backends drop in as a direct replacement for the standard ones.
- What got in the way
- The multi-process caveat is the single most important thing about using this in a real deployment and it is easy to miss — nothing warns you at startup, metrics simply look plausible and are wrong. The instrumented backend wrappers are also named per-engine, so swapping databases for a test run means editing the backend string rather than just a connection URL.