rust-prometheus icon indicating copy to clipboard operation
rust-prometheus copied to clipboard

[RFC] split out a PromRegisterer facade trait?

Open lucab opened this issue 6 years ago • 1 comments

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?

lucab avatar Mar 15 '19 15:03 lucab

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?

breezewish avatar Mar 15 '19 17:03 breezewish