Skip to content

Commit

Permalink
Ignore NaN values in collection.
Browse files Browse the repository at this point in the history
We'll re-enable it when we have a better way in UI to handle these.
  • Loading branch information
rjnagal committed Aug 17, 2015
1 parent ac85d8f commit 374e36d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions collector/prometheus_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package collector
import (
"encoding/json"
"io/ioutil"
"math"
"net/http"
"strconv"
"strings"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 374e36d

Please sign in to comment.