Thanks, this is pretty nice. I would recommend naming it something a little less generic, maybe prometheus_ruby_exporter, since this seems to be a very ruby-specific system.
The other one big downside to this approach is that the lifecycle of the exporter is not directly tied to the ruby code lifecycle. It's desired that when you restart/hup the rails server (
puma, unicorn, etc) the metrics counters are purged. Maybe it would be useful to have a reset method the send-metrics endpoint. This could be called by rails in the startup/hup procedure. This would make it easy for obsolete metric names to be purged on new code releases.
Also, FYI, GitLab has been working on solving the long standing multi-process issue in the official Prometheus ruby client. We have a beta quality gem available for testing, but it will require some work to merge it upstream.