fix: procstat missing tags in procstat_lookup metric (#9808)
In #9488 the way that tags were built for procstat_lookup was changed and it was only including the pid_finder and result tags. This is not consistent with the documentation and is a regression from how they were previously constructed. Becuase of the large change to how procstat metrics are gathered, this will use one of the process metric's tags as a basis for the tags for procstat_lookup. Resolves: #9793
This commit is contained in:
parent
49e5086390
commit
ac40bdc52e
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue