rust-prometheus
rust-prometheus copied to clipboard
docs: clarify exposition flow and expectations
I have just started using this crate and am new to Prometheus. It took me a while to figure out what exporters actually are. I believe this crate doesn't have a built-in exporter. If that is the case, won't it be better if we document that in the README?
For someone like me who's new to it, the question flow was:
- How do I create a counter metric?
- How do I get my metric to show up on Prometheus?
The first part is documented with example code showing how to create a counter metric, but the second question wasn't answered from the README.
I had to look at implementations in other languages (e.g. Python/Java) which have a section about Exporter in their README, to understand they allow support for automatically exposing a /metrics
endpoint, which makes me think:
- I have to expose a
/metrics
endpoint myself - From the help of docs, I understand that I'll have to call
gather
,encode
and return the String from the endpoint
So I think it would be better to have an Exporter section in the README.