stephenhillier / starlette_exporter

Prometheus exporter for Starlette and FastAPI
Apache License 2.0
313 stars 35 forks source link

Document "created" metrics #100

Open ClaytonJY opened 1 month ago

ClaytonJY commented 1 month ago

In addition to the three metrics documented in the README, this package produces two more, starlette_requests_created and starlette_request_duration_seconds_created.

How should these be interpreted? Should they be added to the docs?

I'm particularly confused that they have the same # HELP description as their counterparts without the _created suffix, but these ones are gauges instead of counters.

stephenhillier commented 1 month ago

Hi @ClaytonJY, the Prometheus client library automatically adds a _created metric for any Counters, Histograms, and Summary metrics. There is some (limited) info in the OpenMetrics spec; I also found a brief blurb on this Grafana blog.

I think the bottom line is that they are normal, and managed by the Prometheus client. I assume they're not intended for users of Prometheus to interpret/consume and we can safely ignore them.

I'm away for a week or so but If you still think a brief sentence in the doc to explain what they are would help, I would accept a PR, or I will add something quick when I get back.

Thanks for creating an issue!