feat: Improve error logging on plugin initialization (#10307)

This commit is contained in:
Thomas Casteleyn 2021-12-21 16:59:47 +01:00 committed by GitHub
parent a57aaddb0d
commit 9f7e8befae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -196,28 +196,28 @@ func (a *Agent) initPlugins() error {
err := processor.Init()
if err != nil {
return fmt.Errorf("could not initialize processor %s: %v",
processor.Config.Name, err)
processor.LogName(), err)
}
}
for _, aggregator := range a.Config.Aggregators {
err := aggregator.Init()
if err != nil {
return fmt.Errorf("could not initialize aggregator %s: %v",
aggregator.Config.Name, err)
aggregator.LogName(), err)
}
}
for _, processor := range a.Config.AggProcessors {
err := processor.Init()
if err != nil {
return fmt.Errorf("could not initialize processor %s: %v",
processor.Config.Name, err)
processor.LogName(), err)
}
}
for _, output := range a.Config.Outputs {
err := output.Init()
if err != nil {
return fmt.Errorf("could not initialize output %s: %v",
output.Config.Name, err)
output.LogName(), err)
}
}
return nil