fix(agent): Skip initialization of second processor state if requested (#16290)

This commit is contained in:
Sven Rebhan 2024-12-11 22:33:31 +01:00 committed by GitHub
parent e3ce01abf0
commit d2e032eb4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -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 {