Track MongoDB users operations
The Cloud Manager (née MMS) documentation includes a list of the Database Commands Used by the Monitoring Agent.

The main command to start with is serverStatus, which includes most metrics specific to a mongod instance (as opposed to replica set or sharded cluster information).

You can run this command via a driver and preview the results with the db.serverStatus() helper in the mongo shell.

Available subsections and output may vary depending on the version and configuration of your MongoDB server.

Interesting sections of serverStatus typically include:


opcounters: insert, query, update, delete, command, getmore
opcounters-repl: opcounters that are the result of replicated operations applied on a secondary
connections: current, available, and total created connections
asserts: number and type of assertions that have been raised since the server started


For more information see:


serverStatus command description
Server Status Output