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()
|
err := processor.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not initialize processor %s: %v",
|
return fmt.Errorf("could not initialize processor %s: %v",
|
||||||
processor.Config.Name, err)
|
processor.LogName(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, aggregator := range a.Config.Aggregators {
|
for _, aggregator := range a.Config.Aggregators {
|
||||||
err := aggregator.Init()
|
err := aggregator.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not initialize aggregator %s: %v",
|
return fmt.Errorf("could not initialize aggregator %s: %v",
|
||||||
aggregator.Config.Name, err)
|
aggregator.LogName(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, processor := range a.Config.AggProcessors {
|
for _, processor := range a.Config.AggProcessors {
|
||||||
err := processor.Init()
|
err := processor.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not initialize processor %s: %v",
|
return fmt.Errorf("could not initialize processor %s: %v",
|
||||||
processor.Config.Name, err)
|
processor.LogName(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, output := range a.Config.Outputs {
|
for _, output := range a.Config.Outputs {
|
||||||
err := output.Init()
|
err := output.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not initialize output %s: %v",
|
return fmt.Errorf("could not initialize output %s: %v",
|
||||||
output.Config.Name, err)
|
output.LogName(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue