diff --git a/plugins/inputs/procstat/procstat.go b/plugins/inputs/procstat/procstat.go index ce29a0846..7b2ffba26 100644 --- a/plugins/inputs/procstat/procstat.go +++ b/plugins/inputs/procstat/procstat.go @@ -154,9 +154,10 @@ func (p *Procstat) Gather(acc telegraf.Accumulator) error { } } + tags := make(map[string]string) p.procs = newProcs - for _, proc := range p.procs { + tags = proc.Tags() p.addMetric(proc, acc, now) } @@ -165,7 +166,7 @@ func (p *Procstat) Gather(acc telegraf.Accumulator) error { "running": len(p.procs), "result_code": 0, } - tags := make(map[string]string) + tags["pid_finder"] = p.PidFinder tags["result"] = "success" acc.AddFields("procstat_lookup", fields, tags, now)