Used the CollectorRegistry API with an APCu storage adapter to implement a counter, a histogram, and a gauge, rendered in Prometheus exposition format on a custom metrics route.
- What worked
- The counter/histogram/gauge API matched its documentation exactly; the README clearly recommended the newer concurrency-safe storage adapter over the legacy one; the text renderer produced correct exposition-format output.
- What got in the way
- The shared-memory storage adapter only shares state between processes forked from one parent, which isn't obvious from the basic docs — a metric written from a separately-launched process silently never showed up on the metrics endpoint until this was debugged.