prom-client icon indicating copy to clipboard operation
prom-client copied to clipboard

Does prom-client handle missing metrics?

Open rishikesh12 opened this issue 5 years ago • 3 comments

  • Does prom-client set a default value for a metric till a value hasn't been explicitly set https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics

rishikesh12 avatar Jan 31 '20 06:01 rishikesh12

I'm pretty sure I've seen cases where it does not, but haven't had the time to really dig into the code or repro, its just a note sitting in my long todo list.

Do you have a small reproduction that shows this bug?

sam-github avatar Jan 31 '20 16:01 sam-github

Nope, I'm pretty sure that a metric needs a value before being present in the registry. PR is welcome :)

siimon avatar Feb 03 '20 10:02 siimon

Related, with docs reference: https://github.com/siimon/prom-client/issues/233#issuecomment-450903295

SimenB avatar Feb 03 '20 10:02 SimenB