From 85a7fbc13fa170b793c7e0297454c8d25f463322 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 25 Oct 2021 13:21:39 -0600 Subject: [PATCH] fix: procstat tags were not getting generated correctly (#9973) Fixes: #9961 --- plugins/inputs/procstat/procstat.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/procstat/procstat.go b/plugins/inputs/procstat/procstat.go index cb10d34d2..09b5cc7cf 100644 --- a/plugins/inputs/procstat/procstat.go +++ b/plugins/inputs/procstat/procstat.go @@ -154,13 +154,18 @@ 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) } + tags := make(map[string]string) + for _, pidTag := range pidTags { + for key, value := range pidTag.Tags { + tags[key] = value + } + } + fields := map[string]interface{}{ "pid_count": pidCount, "running": len(p.procs),