rust-prometheus
rust-prometheus copied to clipboard
[RFC] split out a PromRegisterer facade trait?
Context: I'm currently trying to instrument library and application logic in an ergonomic way, see https://github.com/pingcap/rust-prometheus/issues/228 for an example.
I think there may be some benefits in splitting out Collector trait and registry-registering methods into a separate facade crate. Rationale is:
- it can be percolated to all libraries without the full overhead of current crate
- it can be quickly stabilized, allowing the current crate to float more freely
- it decouples metrics recording from exposition
This would be similar to Prometheus client-go Registerer interface: https://godoc.org/github.com/prometheus/client_golang/prometheus#Registerer (but in its own crate to ease semver).
Thoughts on this?
I like the idea of decoupling metrics recording from exposition. Looks like it will be useful in our project TiKV as well. @overvenus How do you think?