Collects MongoDB performance and health metrics


  1. Middleware Host agent should be already installed on your machine, in order to use MongoDB integration.


  1. You will have to create a yaml file in your system containing database collection details, as follows:

Ex. /home/ubuntu/mongodb-creds.yaml

      - endpoint: localhost:27017
    username: mongodb
    password: mongodb
You can skip the fields username and password if database is not password protected.
For Docker Agent Users: If you are running the Middleware Docker agent, then we recommend to keep the creds YAML under /var/log directory. This is because, the Docker agent might not support dynamic volume binding.
  1. Go to Store, Enable MongoDB Integration, Select a host, and set YAML path to the file created in step 1.

Visualize Analytics

There are 2 possible ways to Visualize MongoDB Analytics :

1. Middleware’s Default MongoDB Dashboard

Once you setup the MongoDB Integration, You will be able to see different Analytics in the default MongoDB Dashboard.

2. Create your own dashboard

You can create a dashboard from scratch by yourself.

If you add a new widget to any existing dashboard, you will be able to see list of available MongoDB metrics under the “mongodb” Data source.

You can visualize in many different Widget types i.e. Timeseries, Bar Chart, Pie Chart, etc.

The exhaustive list for MongoDB metrics can be seen here

Metrics collected

mongodb.cache.operationsThe number of cache operations of the instance.
mongodb.collection.countThe number of collections. size of the collection. Data compression does not affect this value.
mongodb.connection.countThe number of connections.
mongodb.extent.countThe number of extents.
mongodb.global_lock.timeThe time the global lock has been held.
mongodb.index.countThe number of indexes.
mongodb.index.sizeSum of the space allocated to all indexes in the database, including free index space.
mongodb.memory.usageThe amount of memory used.
mongodb.object.countThe number of objects.
mongodb.operation.latency.timeThe latency of operations.
mongodb.operation.countThe number of operations executed.
mongodb.operation.repl.countThe number of replicated operations executed. total amount of storage allocated to this collection.
mongodb.database.countThe number of existing databases.
mongodb.index.access.countThe number of times an index has been accessed.
mongodb.document.operation.countThe number of document operations executed. number of bytes received. number of by transmitted. number of requests received by the server.
mongodb.operation.timeThe total time spent performing operations.
mongodb.session.countThe total number of active sessions.
mongodb.cursor.countThe number of open cursors maintained for clients.
mongodb.cursor.timeout.countThe number of cursors that have timed out.
mongodb.lock.acquire.countNumber of times the lock was acquired in the specified mode.
mongodb.lock.acquire.wait_countNumber of times the lock acquisitions encountered waits because the locks were held in a conflicting mode.
mongodb.lock.acquire.timeCumulative wait time for the lock acquisitions.
mongodb.lock.deadlock.countNumber of times the lock acquisitions encountered deadlocks.
mongodb.healthThe health status of the server.
mongodb.uptimeThe amount of time that the server has been running.
Need assistance or want to learn more about Middleware? Contact us at support[at]