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

docs: clarify exposition flow and expectations

Open thatdevsherry opened this issue 3 years ago • 5 comments

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:

  1. How do I create a counter metric?
  2. 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:

  1. I have to expose a /metrics endpoint myself
  2. 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.

thatdevsherry avatar Sep 07 '20 05:09 thatdevsherry