From dcb909f9713ed9d0e053776686f7bbc889548dfe Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Thu, 28 Apr 2022 22:34:38 +0800 Subject: [PATCH] code refactor --- parser/prometheus/parser.go | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/prometheus/parser.go b/parser/prometheus/parser.go index 735d9fe..24fc518 100644 --- a/parser/prometheus/parser.go +++ b/parser/prometheus/parser.go @@ -99,6 +99,7 @@ func (p *Parser) handleSummary(m *dto.Metric, tags map[string]string, metricName func (p *Parser) handleHistogram(m *dto.Metric, tags map[string]string, metricName string, slist *list.SafeList) { slist.PushFront(inputs.NewSample(metricName+"_count", float64(m.GetHistogram().GetSampleCount()), tags)) slist.PushFront(inputs.NewSample(metricName+"_sum", m.GetHistogram().GetSampleSum(), tags)) + slist.PushFront(inputs.NewSample(metricName+"_bucket", float64(m.GetHistogram().GetSampleCount()), tags, map[string]string{"le": "+Inf"})) for _, b := range m.GetHistogram().Bucket { le := fmt.Sprint(b.GetUpperBound())