Fix counter and gauge metric types. (#3232)

This commit is contained in:
Trevor Pounds 2017-09-14 16:05:37 -04:00 committed by Daniel Nelson
parent d557cbd103
commit ef7ce31f9c
1 changed files with 2 additions and 2 deletions

View File

@ -251,14 +251,14 @@ func (s *Statsd) Gather(acc telegraf.Accumulator) error {
}
for _, metric := range s.gauges {
acc.AddFields(metric.name, metric.fields, metric.tags, now)
acc.AddGauge(metric.name, metric.fields, metric.tags, now)
}
if s.DeleteGauges {
s.gauges = make(map[string]cachedgauge)
}
for _, metric := range s.counters {
acc.AddFields(metric.name, metric.fields, metric.tags, now)
acc.AddCounter(metric.name, metric.fields, metric.tags, now)
}
if s.DeleteCounters {
s.counters = make(map[string]cachedcounter)