MongoDB Monitoring


MongoDB is a cross-platform, document oriented database that provides, high performance, high availability and easy scalability. MongoDB works on concept of collection and document.

We have created a monitor plug-in that monitors MongoDB. CMON will made connection to MongoDB database. After making connection with database, monitor will execute some MongoDB API function calls that will provide the health status of the MongoDB sever.

To make connection with MongoDB, user needs to provide connectivity credential to the monitor program, so that it can make connection to the database.

This monitor plugin we will capture following stats:

  • Global lock time
  • Operations currently queued, number waiting for the read-lock or write-lock
  • Total active connections, number of read and write operations
  • Memory metrics including bits, resident RAM, virtual memory, mapped memory, mapped memory with journaling
  • Current and available connections
  • Index counters including index access, hits and misses, resets
  • Background flushing metrics such as number of times, total time, average time, last time
  • Network traffic sent and received (in bytes), number of distinct requests received
  • Number of database operations including: insert, query, update, delete, get more, and total number of commands
  • Number of asserts since the server process started: regular, warnings, message, user, and number of times the rollover counter has rolled
  • Database related stats
  • Cluster related stats (status, health, and uptime)

Note: To make connectivity with Mongo DB, user should add Mongo jdbc jar in class-path.

MongoDB Components

Following are some key Component of MongoDB.


Database is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases.


Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose.


A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection’s documents may hold different types of data.

MongoDB Metrics

MongoDB Server Stats
Graph NameData Type Graph Description
MongoDB Up Time (Days)SampleDuration of time in days since the server is up.
MongoDB Current ConnectionsSampleNumber of current connections to the database server from clients. This number includes the current shell connection as well as any inter-node connections to support a replica set or sharded cluster.
MongoDB Available ConnectionsSampleNumber of unused available connections that the database can provide. Consider this value in combination with the value of Current to understand the connection load on the database.
MongoDB Global Lock Time (Sec)CumulativeTotal time since the global Lock was started and created.
MongoDB Readers Lock WaitingSampleNumber of operations waiting for the read-lock.
MongoDB Writers Lock WaitingSampleNumber of operations waiting for the write-lock.
MongoDB Active ConnectionsSampleNumber of active client connections to the database.
MongoDB ReadersSampleNumber of readers performing read operations to the database.
MongoDB WritersSampleNumber of writers performing write operations to database.
MongoDB Used Resident Memory (MB)SampleAmount of RAM in Megabytes currently used by the database process.
MongoDB Used Virtual Memory (MB)SampleAmount of virtual memory in Megabytes currently used by the mongod process.
MongoDB Mapped Memory (MB)SampleAmount of mapped memory in Megabytes currently used by the mongod process.
MongoDB Mapped With Journal Memory (MB)SampleAmount of mapped memory in Megabytes, including memory used for journaling.
MongoDB Received Throughput (Kbps)SampleAmount of network traffic received in kilo bits per seconds(kbps).
MongoDB Sent Throughput (Kbps)SampleAmount of network traffic sent in kilo bits per second(kbps).
MongoDB Requests/MinRateNumber of distinct requests that the server has received per minute.
MongoDB Inserts/SecRateNumber of insert operations to database per second.
MongoDB Queries/SecRateNumber of query operations to database per second.
MongoDB Updates/SecRateNumber of update operations to database per second.
MongoDB Deletes/SecRateNumber of delete operations to database per second.
MongoDB Commands/SecRateNumber of commands issued to database per second.
MongoDB Message Assertions/SecRateNumber of message assertions raised per second. Message asserts indicate internal server exceptions.
MongoDB Warning Assertions/SecRateNumber of warning assertions raised per second. Warning asserts indicate things that might be worth checking like too low ulimit or readahead.
MongoDB Regular Assertion/SecRateNumber of regular assertions raised per second. Regular asserts are per-operation invariants (e.g. “unexpected failure while reading a BSON document”).
MongoDB User Assertions/SecRateNumber of assertions corresponding to errors generated by users per second. User asserts are triggered as the result of user operations or commands generating an error like a full disk space, a duplicate key exception, or write errors (e.g. insert not properly formatted, or no access right).

Graphical Representation

MongoDB Database Stats
Graph NameData Type Graph Description
MongoDB Average Object Size (MB)SampleAverage size of each document in Megabytes. This is the dataSize divided by the number of documents.
MongoDB Collections CountSampleNumber of collections in that database.
MongoDB Data Size (GB)SampleTotal size in Gigabytes of the data held in this database including the padding factor.
MongoDB IndexesSampleTotal number of indexes across all collections in the database.
MongoDB Indexes Size (MB)SampleTotal size in Megabytes of all indexes created on this database.
MongoDB ExtentsSampleNumber of extents in the database across all collections.
MongoDB ObjectsSampleNumber of objects (i.e. documents) in the database across all collections.
MongoDB Storage Size (GBSampleTotal amount of space in Gigabytes allocated to collections in this database for document storage.

Graphical Representation

MongoDB Collection Stats
Graph NameData Type Graph Description
MongoDB Collection DocumentsSampleNumber of objects or documents in this collection.
MongoDB Collection Size (MB)SampleSize of the data stored in this collection in Megabytes.
MongoDB Collection Average Object SizeSampleThe average size of an object in the collection in Megabytes.
MongoDB Collection Document Storage Size (MB)SampleTotal amount of storage allocated to this collection for document storage in Megabytes.
MongoDB Collection Index CountSampleNumber of indexes on the collection. All collections have at least one index on the _id field.
MongoDB Collection Index Size (MB)SampleTotal size of all indexes in Megabytes.

Graphical Representation