From 917d590fa9f8726e303720b02633ce544626a596 Mon Sep 17 00:00:00 2001 From: ruotiantang Date: Mon, 2 Dec 2024 15:40:55 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20Agent=E6=B2=A1=E6=9C=89=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E7=9B=91=E6=8E=A7=E4=BC=9A=E6=97=A0=E9=99=90=E6=89=93?= =?UTF-8?q?=E6=97=A5=E5=BF=97=20#11274?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agent/agent/src/pkg/collector/collector.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/agent/agent/src/pkg/collector/collector.go b/src/agent/agent/src/pkg/collector/collector.go index dd2e528cae5..9c8bdf6bb22 100644 --- a/src/agent/agent/src/pkg/collector/collector.go +++ b/src/agent/agent/src/pkg/collector/collector.go @@ -58,6 +58,11 @@ const ( func Collect() { logs.Debug("do Collect") + if config.GAgentConfig.CollectorOn == false { + logs.Info("agent collector off") + return + } + ipChan := config.EBus.Subscribe(config.IpEvent, eBusId, 1) defer func() { @@ -79,11 +84,6 @@ func Collect() { } func doAgentCollect(ctx context.Context) { - if config.GAgentConfig.CollectorOn == false { - logs.Info("agent collector off") - return - } - configContent, err := genTelegrafConfig() if err != nil { logs.WithError(err).Error("genTelegrafConfig error")