more detail name for prom parser method

This commit is contained in:
kongfei 2022-06-30 11:02:14 +08:00
parent fe549740ae
commit a5872ea797
1 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ func (p *Parser) Parse(buf []byte, slist *list.SafeList) error {
} else if mf.GetType() == dto.MetricType_HISTOGRAM {
p.handleHistogram(m, tags, metricName, slist)
} else {
p.handleSample(m, tags, metricName, slist)
p.handleGaugeCounter(m, tags, metricName, slist)
}
}
}
@ -112,7 +112,7 @@ func (p *Parser) handleHistogram(m *dto.Metric, tags map[string]string, metricNa
}
}
func (p *Parser) handleSample(m *dto.Metric, tags map[string]string, metricName string, slist *list.SafeList) {
func (p *Parser) handleGaugeCounter(m *dto.Metric, tags map[string]string, metricName string, slist *list.SafeList) {
fields := getNameAndValue(m, metricName)
for metric, value := range fields {
slist.PushFront(inputs.NewSample(prom.BuildMetric(p.NamePrefix, metric, ""), value, tags))