fix(agent): Skip initialization of second processor state if requested (#16290)
This commit is contained in:
parent
e3ce01abf0
commit
d2e032eb4a
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue