Skip to content

Commit

Permalink
fix(inputs.mongodb): Do not dereference nil pointer if gathering data…
Browse files Browse the repository at this point in the history
…base stats fails (#16310)
  • Loading branch information
dkhamitov authored Dec 17, 2024
1 parent 7360f5d commit 3b87986
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/inputs/mongodb/mongodb_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ func (s *server) gatherData(acc telegraf.Accumulator, gatherClusterStatus, gathe
for _, name := range names {
db, err := s.gatherDBStats(name)
if err != nil {
s.log.Debugf("Error getting db stats from %q: %s", name, err.Error())
s.log.Errorf("Error getting db stats from %q: %v", name, err)
continue
}
dbStats.Dbs = append(dbStats.Dbs, *db)
}
Expand Down

0 comments on commit 3b87986

Please sign in to comment.