From 544aa71ba6d80c2a4b2aece17319df6ea9083228 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Thu, 21 Apr 2022 18:18:17 +0800 Subject: [PATCH] no gather extend metrics if len(pids) == 0 --- inputs/procstat/procstat.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inputs/procstat/procstat.go b/inputs/procstat/procstat.go index 3c4ea21..0c82ad1 100644 --- a/inputs/procstat/procstat.go +++ b/inputs/procstat/procstat.go @@ -154,6 +154,10 @@ func (s *Procstat) gatherOnce(slist *list.SafeList, ins *Instance) { } slist.PushFront(inputs.NewSample("lookup_count", len(pids), tags)) + if len(pids) == 0 { + return + } + if len(ins.GatherMoreMetrics) == 0 { return }