Merge pull request #856 from rjnagal/docker
Ignore NaN values in collection.
This commit is contained in:
commit
9db0c2e26f
@ -17,6 +17,7 @@ package collector
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -153,6 +154,9 @@ func (collector *PrometheusCollector) Collect(metrics map[string][]v1.MetricVal)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
errorSlice = append(errorSlice, err)
|
errorSlice = append(errorSlice, err)
|
||||||
}
|
}
|
||||||
|
if math.IsNaN(metVal) {
|
||||||
|
metVal = 0
|
||||||
|
}
|
||||||
|
|
||||||
metric := v1.MetricVal{
|
metric := v1.MetricVal{
|
||||||
Label: metLabel,
|
Label: metLabel,
|
||||||
|
Loading…
Reference in New Issue
Block a user