prom-client: NaN metric is not reported
Not A Number (NaN) is a supported metric according to EXPOSITION FORMATS
value is a float represented as required by Go’s ParseFloat() function. In addition to standard numerical values, Nan, +Inf, and -Inf are valid values representing not a number, positive infinity, and negative infinity, respectively.
However, this is not tracked when doing the following:
var nanGauge = Prometheus.Client.Metrics.CreateGauge("nan", "metric with nan value");
nanGauge.Set(double.NaN);
Expected Outcome
# HELP nan metric with nan value
# TYPE nan gauge
Nan
Actual Outcome
# HELP nan metric with nan value
# TYPE nan gauge
Repro
Pull https://github.com/tomkerkhove/prometheus-nan-repro and consume /repro
endpoint.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 32 (14 by maintainers)
Commits related to this issue
- Add NaN support in Gauge #65 — committed to prom-client-net/prom-client by sanych-sun 5 years ago
- Merge pull request #74 from PrometheusClientNet/gauge-to-accept-NaN Add NaN support in Gauge #65 — committed to prom-client-net/prom-client by phnx47 5 years ago
Sure that’s fine - Thanks!
That would be prefect for me! Thanks for considering!