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
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 4 additions and 1 deletions

View File

@ -100,7 +100,10 @@ func (m *MongoDB) Gather(acc telegraf.Accumulator) error {
wg.Add(1) wg.Add(1)
go func(srv *Server) { go func(srv *Server) {
defer wg.Done() 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)) }(m.getMongoServer(u))
} }