diff --git a/plugins/inputs/mongodb/README.md b/plugins/inputs/mongodb/README.md index 96852d724..105584462 100644 --- a/plugins/inputs/mongodb/README.md +++ b/plugins/inputs/mongodb/README.md @@ -48,11 +48,18 @@ Error in input [mongodb]: not authorized on admin to execute command { serverSta - active_reads (integer) - active_writes (integer) - commands_per_sec (integer) + - connections_current (integer) + - connections_available (integer) + - connections_total_created (integer) - cursor_timed_out (integer) - cursor_no_timeout (integer) - cursor_pinned (integer) - cursor_total (integer) - deletes_per_sec (integer) + - document_deleted (integer) + - document_inserted (integer) + - document_returned (integer) + - document_updated (integer) - flushes_per_sec (integer) - getmores_per_sec (integer) - inserts_per_sec (integer) diff --git a/plugins/inputs/mongodb/mongostat.go b/plugins/inputs/mongodb/mongostat.go index 1acda5826..e32596deb 100644 --- a/plugins/inputs/mongodb/mongostat.go +++ b/plugins/inputs/mongodb/mongostat.go @@ -633,6 +633,12 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec returnVal.TotalC = diff(newStat.Metrics.Cursor.Open.Total, oldStat.Metrics.Cursor.Open.Total, sampleSecs) } } + if newStat.Metrics.Document != nil { + returnVal.DeletedD = newStat.Metrics.Document.Deleted + returnVal.InsertedD = newStat.Metrics.Document.Inserted + returnVal.ReturnedD = newStat.Metrics.Document.Returned + returnVal.UpdatedD = newStat.Metrics.Document.Updated + } } if newStat.OpcountersRepl != nil && oldStat.OpcountersRepl != nil {