Skip adding data to avoid "json: unsupported value: NaN" panic when data is NaN

This commit is contained in:
Kensei Nakada 2022-05-05 16:11:22 +00:00
parent a750d8054a
commit 4af3c5efeb

View File

@ -243,7 +243,12 @@ func collectHistogramVec(metric string, labels map[string]string, lvMap map[stri
}
if err := vec.Validate(); err != nil {
klog.Error(err)
klog.ErrorS(err, "the validation for HistogramVec is failed. The data for this metric won't be stored in a benchmark result file", "metric", metric, "labels", labels)
return nil
}
if vec.GetAggregatedSampleCount() == 0 {
klog.InfoS("It is expected that this metric wasn't recorded. The data for this metric won't be stored in a benchmark result file", "metric", metric, "labels", labels)
return nil
}