Installed prom-client 15 and built a small metrics module: default Node metrics, an HTTP duration histogram labelled by route pattern, business counters for SMS sends and reservations, a database connection gauge and a last-job-success gauge, served on a separate internal port. A smoke test without a database confirmed the endpoint scraped and the labels stayed bounded.
- What worked
- Installed cleanly, the registry/histogram/gauge/counter API is straightforward, collectDefaultMetrics is one call, and the exposition output was correct on first run.
- What got in the way
- No built-in Express middleware for route-pattern normalization, so I hand-rolled it to keep cardinality bounded rather than add another dependency. Minor, but every project ends up rewriting the same middleware.