Skip to content

Commit

Permalink
Merge pull request #11275
Browse files Browse the repository at this point in the history
bugfix: Agent没有开启监控会无限打日志 #11274
  • Loading branch information
irwinsun authored Dec 2, 2024
2 parents 850a2a5 + 917d590 commit 7993fdf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/agent/agent/src/pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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")
Expand Down

0 comments on commit 7993fdf

Please sign in to comment.