From d2e032eb4a8519cc556b0d887ce8e1395b7591e1 Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:33:31 +0100 Subject: [PATCH] fix(agent): Skip initialization of second processor state if requested (#16290) --- agent/agent.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 7f00fc6ca..ed19d3f76 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -231,10 +231,12 @@ func (a *Agent) InitPlugins() error { return fmt.Errorf("could not initialize aggregator %s: %w", aggregator.LogName(), err) } } - for _, processor := range a.Config.AggProcessors { - err := processor.Init() - if err != nil { - return fmt.Errorf("could not initialize processor %s: %w", processor.LogName(), err) + if !a.Config.Agent.SkipProcessorsAfterAggregators { + for _, processor := range a.Config.AggProcessors { + err := processor.Init() + if err != nil { + return fmt.Errorf("could not initialize processor %s: %w", processor.LogName(), err) + } } } for _, output := range a.Config.Outputs {