diff --git a/model/textparse/protobufparse.go b/model/textparse/protobufparse.go index 2ef52da5c..29ccdb84d 100644 --- a/model/textparse/protobufparse.go +++ b/model/textparse/protobufparse.go @@ -105,7 +105,7 @@ func (p *ProtobufParser) Series() ([]byte, *int64, float64) { v = float64(s.GetSampleCount()) case -1: v = s.GetSampleSum() - // Need to detect a summaries without quantile here. + // Need to detect summaries without quantile here. if len(s.GetQuantile()) == 0 { p.fieldsDone = true } @@ -564,8 +564,10 @@ func formatOpenMetricsFloat(f float64) string { // deciding if a histogram should be ingested as a conventional one or a native // one. func isNativeHistogram(h *dto.Histogram) bool { - return len(h.GetNegativeDelta()) > 0 || - len(h.GetPositiveDelta()) > 0 || + return h.GetZeroThreshold() > 0 || h.GetZeroCount() > 0 || - h.GetZeroThreshold() > 0 + len(h.GetNegativeDelta()) > 0 || + len(h.GetPositiveDelta()) > 0 || + len(h.GetNegativeCount()) > 0 || + len(h.GetPositiveCount()) > 0 }