From 374e36d38e70621ae0ce25c7bbc0dc0b52053b0d Mon Sep 17 00:00:00 2001 From: Rohit Jnagal Date: Mon, 17 Aug 2015 23:24:19 +0000 Subject: [PATCH] Ignore NaN values in collection. We'll re-enable it when we have a better way in UI to handle these. --- collector/prometheus_collector.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/collector/prometheus_collector.go b/collector/prometheus_collector.go index ca332d59..9253a06d 100644 --- a/collector/prometheus_collector.go +++ b/collector/prometheus_collector.go @@ -17,6 +17,7 @@ package collector import ( "encoding/json" "io/ioutil" + "math" "net/http" "strconv" "strings" @@ -153,6 +154,9 @@ func (collector *PrometheusCollector) Collect(metrics map[string][]v1.MetricVal) if err != nil { errorSlice = append(errorSlice, err) } + if math.IsNaN(metVal) { + metVal = 0 + } metric := v1.MetricVal{ Label: metLabel,