Don't log if no error in mongodb input

This commit is contained in:
Daniel Nelson
2019-11-12 13:44:57 -08:00
parent 7717375bc9
commit 898c20c01e

View File

@@ -100,7 +100,10 @@ func (m *MongoDB) Gather(acc telegraf.Accumulator) error {
wg.Add(1)
go func(srv *Server) {
defer wg.Done()
m.Log.Error(m.gatherServer(srv, acc))
err := m.gatherServer(srv, acc)
if err != nil {
m.Log.Errorf("Error in plugin: %v", err)
}
}(m.getMongoServer(u))
}