feat: Improve error logging on plugin initialization (#10307)
This commit is contained in:
parent
a57aaddb0d
commit
9f7e8befae
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue