From 4ffd6484b1c8b5fdac94915cc5e35ea210cb4b8b Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 21 Jan 2021 17:16:09 +0100 Subject: [PATCH] more descriptive comment --- x-pack/elastic-agent/pkg/agent/operation/monitoring.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go index b8c605040b0..882f9efdf14 100644 --- a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go +++ b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go @@ -129,7 +129,8 @@ func (o *Operator) generateMonitoringSteps(version string, output interface{}) [ watchLogs := o.monitor.WatchLogs() watchMetrics := o.monitor.WatchMetrics() - // generate only on change + // generate only when monitoring is running (for config refresh) or + // state changes (turning on/off) if watchLogs != o.isMonitoringLogs() || watchLogs { fbConfig, any := o.getMonitoringFilebeatConfig(output) stepID := configrequest.StepRun