Logging is here!

MongoDB

Agent Check Agent Check

Supported OS: Linux Mac OS Windows

Overview

Connect MongoDB to Datadog in order to:

  • Visualize key MongoDB metrics.
  • Correlate MongoDB performance with the rest of your applications.

Setup

Installation

The MongoDB check is included in the Datadog Agent package, so you don’t need to install anything else on your MongoDB masters.

Configuration

Edit the mongo.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your MongoDB metrics and logs. See the sample mongo.yaml for all available configuration options.

Prepare MongoDB

In a mongo shell, create a read-only user for the Datadog Agent in the admin database:

# Authenticate as the admin user.
use admin
db.auth("admin", "<YOUR_MONGODB_ADMIN_PASSWORD>")

# On MongoDB 2.x, use the addUser command.
db.addUser("datadog", "<UNIQUEPASSWORD>", true)

# On MongoDB 3.x or higher, use the createUser command.
db.createUser({
  "user":"datadog",
  "pwd": "<UNIQUEPASSWORD>",
  "roles" : [
    {role: 'read', db: 'admin' },
    {role: 'clusterMonitor', db: 'admin'},
    {role: 'read', db: 'local' }
  ]
})

Metric Collection

  init_config:
  instances:
    - server: mongodb://datadog:<UNIQUEPASSWORD>@localhost:27017/admin
      additional_metrics:
        - collection       # collect metrics for each collection
        - metrics.commands
        - tcmalloc
        - top

See the sample mongo.yaml for all available configuration options

Log Collection

Available for Agent >6.0

  • Collecting logs is disabled by default in the Datadog Agent, you need to enable it in datadog.yaml:
  logs_enabled: true
  • Add this configuration block to your mongo.d/conf.yaml file to start collecting your MongoDB Logs:
  logs:
      - type: file
        path: /var/log/mongodb/mongodb.log
        service: mongo
        source: mongodb

Change the service and path parameter values and configure them for your environment. See the sample mongo.yaml for all available configuration options

Learn more about log collection in the log documentation

Validation

Run the Agent’s status subcommand and look for mongo under the Checks section.

Data Collected

Metrics

mongodb.asserts.msgps
(gauge)
Number of message assertions raised per second.
shown as assertion
mongodb.asserts.regularps
(gauge)
Number of regular assertions raised per second.
shown as assertion
mongodb.asserts.rolloversps
(gauge)
Number of times that the rollover counters roll over per second. The counters rollover to zero every 2^30 assertions.
shown as assertion
mongodb.asserts.userps
(gauge)
Number of user assertions raised per second.
shown as assertion
mongodb.asserts.warningps
(gauge)
Number of warnings raised per second.
shown as assertion
mongodb.backgroundflushing.average_ms
(gauge)
Average time for each flush to disk.
shown as millisecond
mongodb.backgroundflushing.flushesps
(gauge)
Number of times the database has flushed all writes to disk.
shown as flush
mongodb.backgroundflushing.last_ms
(gauge)
Amount of time that the last flush operation took to complete.
shown as millisecond
mongodb.backgroundflushing.total_ms
(gauge)
Total number of time that the `mongod` processes have spent writing (i.e. flushing) data to disk.
shown as millisecond
mongodb.connections.available
(gauge)
Number of unused available incoming connections the database can provide.
shown as connection
mongodb.connections.current
(gauge)
Number of connections to the database server from clients.
shown as connection
mongodb.connections.totalcreated
(gauge)
Total number of connections created.
shown as connection
mongodb.cursors.timedout
(gauge)
Total number of cursors that have timed out since the server process started.
shown as cursor
mongodb.cursors.totalopen
(gauge)
Number of cursors that MongoDB is maintaining for clients
shown as cursor
mongodb.dbs
(gauge)
Total number of existing databases
shown as item
mongodb.dur.commits
(gauge)
Number of transactions written to the journal during the last journal group commit interval.
shown as transaction
mongodb.dur.commitsinwritelock
(gauge)
Count of the commits that occurred while a write lock was held.
shown as commit
mongodb.dur.compression
(gauge)
Compression ratio of the data written to the journal.
shown as fraction
mongodb.dur.earlycommits
(gauge)
Number of times MongoDB requested a commit before the scheduled journal group commit interval.
shown as commit
mongodb.dur.journaledmb
(gauge)
Amount of data written to journal during the last journal group commit interval.
shown as mebibyte
mongodb.dur.timems.commits
(gauge)
Amount of time spent for commits.
shown as millisecond
mongodb.dur.timems.commitsinwritelock
(gauge)
Amount of time spent for commits that occurred while a write lock was held.
shown as millisecond
mongodb.dur.timems.dt
(gauge)
Amount of time over which MongoDB collected the `dur.timeMS` data.
shown as millisecond
mongodb.dur.timems.preplogbuffer
(gauge)
Amount of time spent preparing to write to the journal.
shown as millisecond
mongodb.dur.timems.remapprivateview
(gauge)
Amount of time spent remapping copy-on-write memory mapped views.
shown as millisecond
mongodb.dur.timems.writetodatafiles
(gauge)
Amount of time spent writing to data files after journaling.
shown as millisecond
mongodb.dur.timems.writetojournal
(gauge)
Amount of time spent writing to the journal
shown as millisecond
mongodb.dur.writetodatafilesmb
(gauge)
Amount of data written from journal to the data files during the last journal group commit interval.
shown as mebibyte
mongodb.extra_info.page_faultsps
(gauge)
Number of page faults per second that require disk operations.
shown as fault
mongodb.fsynclocked
(gauge)
Number of fsynclocked performed on a mongo instance.
mongodb.globallock.activeclients.readers
(gauge)
Count of the active client connections performing read operations.
shown as connection
mongodb.globallock.activeclients.total
(gauge)
Total number of active client connections to the database.
shown as connection
mongodb.globallock.activeclients.writers
(gauge)
Count of active client connections performing write operations.
shown as connection
mongodb.globallock.currentqueue.readers
(gauge)
Number of operations that are currently queued and waiting for the read lock.
shown as operation
mongodb.globallock.currentqueue.total
(gauge)
Total number of operations queued waiting for the lock.
shown as operation
mongodb.globallock.currentqueue.writers
(gauge)
Number of operations that are currently queued and waiting for the write lock.
shown as operation
mongodb.globallock.locktime
(gauge)
Time since the database last started that the globalLock has been held.
shown as millisecond
mongodb.globallock.ratio
(gauge)
Ratio of the time that the globalLock has been held to the total time since it was created.
shown as fraction
mongodb.globallock.totaltime
(gauge)
Time since the database last started and created the global lock.
shown as microsecond
mongodb.indexcounters.accessesps
(gauge)
Number of times that operations have accessed indexes per second.
shown as event
mongodb.indexcounters.hitsps
(gauge)
Number of times per second that an index has been accessed and mongod is able to return the index from memory.
shown as hit
mongodb.indexcounters.missesps
(gauge)
Number of times per second that an operation attempted to access an index that was not in memory.
shown as miss
mongodb.indexcounters.missratio
(gauge)
Ratio of index hits to misses.
shown as fraction
mongodb.indexcounters.resetsps
(gauge)
Number of times per second the index counters have been reset.
shown as event
mongodb.locks.collection.acquirecount.exclusiveps
(gauge)
Number of times the collection lock type was aquired in the Exclusive (X) mode.
shown as lock
mongodb.locks.collection.acquirecount.intent_exclusiveps
(gauge)
Number of times the collection lock type was aquired in the Intent Exclusive (IX) mode.
shown as lock
mongodb.locks.collection.acquirecount.intent_sharedps
(gauge)
Number of times the collection lock type was aquired in the Intent Shared (IS) mode.
shown as lock
mongodb.locks.collection.acquirecount.sharedps
(gauge)
Number of times the collection lock type was aquired in the Shared (S) mode.
shown as lock
mongodb.locks.collection.acquirewaitcount.exclusiveps
(gauge)
Number of times the collection lock type acquisition in the Exclusive (X) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.collection.acquirewaitcount.sharedps
(gauge)
Number of times the collection lock type acquisition in the Shared (S) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.collection.timeacquiringmicros.exclusiveps
(gauge)
Wait time for the collection lock type acquisitions in the Exclusive (X) mode.
shown as fraction
mongodb.locks.collection.timeacquiringmicros.sharedps
(gauge)
Wait time for the collection lock type acquisitions in the Shared (S) mode.
shown as fraction
mongodb.locks.database.acquirecount.exclusiveps
(gauge)
Number of times the database lock type was aquired in the Exclusive (X) mode.
shown as lock
mongodb.locks.database.acquirecount.intent_exclusiveps
(gauge)
Number of times the database lock type was aquired in the Intent Exclusive (IX) mode.
shown as lock
mongodb.locks.database.acquirecount.intent_sharedps
(gauge)
Number of times the database lock type was aquired in the Intent Shared (IS) mode.
shown as lock
mongodb.locks.database.acquirecount.sharedps
(gauge)
Number of times the database lock type was aquired in the Shared (S) mode.
shown as lock
mongodb.locks.database.acquirewaitcount.exclusiveps
(gauge)
Number of times the database lock type acquisition in the Exclusive (X) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.database.acquirewaitcount.intent_exclusiveps
(gauge)
Number of times the database lock type acquisition in the Intent Exclusive (IX) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.database.acquirewaitcount.intent_sharedps
(gauge)
Number of times the database lock type acquisition in the Intent Shared (IS) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.database.acquirewaitcount.sharedps
(gauge)
Number of times the database lock type acquisition in the Shared (S) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.database.timeacquiringmicros.exclusiveps
(gauge)
Wait time for the database lock type acquisitions in the Exclusive (X) mode.
shown as fraction
mongodb.locks.database.timeacquiringmicros.intent_exclusiveps
(gauge)
Wait time for the database lock type acquisitions in the Intent Exclusive (IX) mode.
shown as fraction
mongodb.locks.database.timeacquiringmicros.intent_sharedps
(gauge)
Wait time for the database lock type acquisitions in the Intent Shared (IS) mode.
shown as fraction
mongodb.locks.database.timeacquiringmicros.sharedps
(gauge)
Wait time for the database lock type acquisitions in the Shared (S) mode.
shown as fraction
mongodb.locks.global.acquirecount.exclusiveps
(gauge)
Number of times the global lock type was aquired in the Exclusive (X) mode.
shown as lock
mongodb.locks.global.acquirecount.intent_exclusiveps
(gauge)
Number of times the global lock type was aquired in the Intent Exclusive (IX) mode.
shown as lock
mongodb.locks.global.acquirecount.intent_sharedps
(gauge)
Number of times the global lock type was aquired in the Intent Shared (IS) mode.
shown as lock
mongodb.locks.global.acquirecount.sharedps
(gauge)
Number of times the global lock type was aquired in the Shared (S) mode.
shown as lock
mongodb.locks.global.acquirewaitcount.exclusiveps
(gauge)
Number of times the global lock type acquisition in the Exclusive (X) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.global.acquirewaitcount.intent_exclusiveps
(gauge)
Number of times the global lock type acquisition in the Intent Exclusive (IX) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.global.acquirewaitcount.intent_sharedps
(gauge)
Number of times the global lock type acquisition in the Intent Shared (IS) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.global.acquirewaitcount.sharedps
(gauge)
Number of times the global lock type acquisition in the Shared (S) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.global.timeacquiringmicros.exclusiveps
(gauge)
Wait time for the global lock type acquisitions in the Exclusive (X) mode.
shown as fraction
mongodb.locks.global.timeacquiringmicros.intent_exclusiveps
(gauge)
Wait time for the global lock type acquisitions in the Intent Exclusive (IX) mode.
shown as fraction
mongodb.locks.global.timeacquiringmicros.intent_sharedps
(gauge)
Wait time for the global lock type acquisitions in the Intent Shared (IS) mode.
shown as fraction
mongodb.locks.global.timeacquiringmicros.sharedps
(gauge)
Wait time for the global lock type acquisitions in the Shared (S) mode.
shown as fraction
mongodb.locks.metadata.acquirecount.exclusiveps
(gauge)
Number of times the metadata lock type was aquired in the Exclusive (X) mode.
shown as lock
mongodb.locks.metadata.acquirecount.sharedps
(gauge)
Number of times the metadata lock type was aquired in the Shared (S) mode.
shown as lock
mongodb.locks.mmapv1journal.acquirecount.intent_exclusiveps
(gauge)
Number of times the MMAPv1 storage engine lock type was aquired in the Intent Exclusive (IX) mode.
shown as lock
mongodb.locks.mmapv1journal.acquirecount.intent_sharedps
(gauge)
Number of times the MMAPv1 storage engine lock type was aquired in the Intent Shared (IS) mode.
shown as lock
mongodb.locks.mmapv1journal.acquirewaitcount.intent_exclusiveps
(gauge)
Number of times the MMAPv1 storage engine lock type acquisition in the Intent Exclusive (IX) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.mmapv1journal.acquirewaitcount.intent_sharedps
(gauge)
Number of times the MMAPv1 storage engine lock type acquisition in the Intent Shared (IS) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.mmapv1journal.timeacquiringmicros.intent_exclusiveps
(gauge)
Wait time for the MMAPv1 storage engine lock type acquisitions in the Intent Exclusive (IX) mode.
shown as fraction
mongodb.locks.mmapv1journal.timeacquiringmicros.intent_sharedps
(gauge)
Wait time for the MMAPv1 storage engine lock type acquisitions in the Intent Shared (IS) mode.
shown as fraction
mongodb.locks.oplog.acquirecount.intent_exclusiveps
(gauge)
Number of times the oplog lock type was aquired in the Intent Exclusive (IX) mode.
shown as lock
mongodb.locks.oplog.acquirecount.sharedps
(gauge)
Number of times the oplog lock type was aquired in the Shared (S) mode.
shown as lock
mongodb.locks.oplog.acquirewaitcount.intent_exclusiveps
(gauge)
Number of times the oplog lock type acquisition in the Intent Exclusive (IX) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.oplog.acquirewaitcount.sharedps
(gauge)
Number of times the oplog lock type acquisition in the Shared (S) mode encountered waits because the locks were held in a conflicting mode.
shown as wait
mongodb.locks.oplog.timeacquiringmicros.intent_exclusiveps
(gauge)
Wait time for the oplog lock type acquisitions in the Intent Exclusive (IX) mode.
shown as fraction
mongodb.locks.oplog.timeacquiringmicros.sharedps
(gauge)
Wait time for the oplog lock type acquisitions in the Shared (S) mode.
shown as fraction
mongodb.mem.bits
(gauge)
Size of the in-memory storage engine.
shown as mebibyte
mongodb.mem.mapped
(gauge)
Amount of mapped memory by the database.
shown as mebibyte
mongodb.mem.mappedwithjournal
(gauge)
The amount of mapped memory, including the memory used for journaling.
shown as mebibyte
mongodb.mem.resident
(gauge)
Amount of memory currently used by the database process.
shown as mebibyte
mongodb.mem.virtual
(gauge)
Amount of virtual memory used by the mongod process.
shown as mebibyte
mongodb.metrics.commands.count.failed
(rate)
Number of times count failed
shown as command
mongodb.metrics.commands.count.total
(gauge)
Number of times count executed
shown as command
mongodb.metrics.commands.createIndexes.failed
(rate)
Number of times createIndexes failed
shown as command
mongodb.metrics.commands.createIndexes.total
(gauge)
Number of times createIndexes executed
shown as command
mongodb.metrics.commands.delete.failed
(rate)
Number of times delete failed
shown as command
mongodb.metrics.commands.delete.total
(gauge)
Number of times delete executed
shown as command
mongodb.metrics.commands.eval.failed
(rate)
Number of times eval failed
shown as command
mongodb.metrics.commands.eval.total
(gauge)
Number of times eval executed
shown as command
mongodb.metrics.commands.findAndModify.failed
(rate)
Number of times findAndModify failed
shown as command
mongodb.metrics.commands.findAndModify.total
(gauge)
Number of times findAndModify executed
shown as command
mongodb.metrics.commands.insert.failed
(rate)
Number of times insert failed
shown as command
mongodb.metrics.commands.insert.total
(gauge)
Number of times insert executed
shown as command
mongodb.metrics.commands.update.failed
(rate)
Number of times update failed
shown as command
mongodb.metrics.commands.update.total
(gauge)
Number of times update executed
shown as command
mongodb.metrics.cursor.open.notimeout
(gauge)
Number of open cursors with the option `DBQuery.Option.noTimeout` set to prevent timeout after a period of inactivity.
shown as cursor
mongodb.metrics.cursor.open.pinned
(gauge)
Number of pinned open cursors.
shown as cursor
mongodb.metrics.cursor.open.total
(gauge)
Number of cursors that MongoDB is maintaining for clients.
shown as cursor
mongodb.metrics.cursor.timedoutps
(gauge)
Number of cursors that time out, per second.
shown as cursor
mongodb.metrics.document.deletedps
(gauge)
Number of documents deleted per second.
shown as document
mongodb.metrics.document.insertedps
(gauge)
Number of documents inserted per second.
shown as document
mongodb.metrics.document.returnedps
(gauge)
Number of documents returned by queries per second.
shown as document
mongodb.metrics.document.updatedps
(gauge)
Number of documents updated per second.
shown as document
mongodb.metrics.getlasterror.wtime.numps
(gauge)
Number of getLastError operations per second with a specified write concern (i.e. w) that wait for one or more members of a replica set to acknowledge the write operation.
shown as operation
mongodb.metrics.getlasterror.wtime.totalmillisps
(gauge)
Fraction of time (ms/s) that the mongod has spent performing getLastError operations with write concern (i.e. w) that wait for one or more members of a replica set to acknowledge the write operation.
shown as fraction
mongodb.metrics.getlasterror.wtimeoutsps
(gauge)
Number of times per second that write concern operations have timed out as a result of the wtimeout threshold to getLastError
shown as event
mongodb.metrics.operation.fastmodps
(gauge)
Number of update operations per second that neither cause documents to grow nor require updates to the index.
shown as operation
mongodb.metrics.operation.idhackps
(gauge)
Number of queries per second that contain the _id field.
shown as query
mongodb.metrics.operation.writeconflictsps
(rate)
Number of times per second that write concern operations has encounter a conflict.
shown as event
mongodb.metrics.operation.scanandorderps
(gauge)
Number of queries per second that return sorted numbers that cannot perform the sort operation using an index.
shown as query
mongodb.metrics.queryexecutor.scannedps
(gauge)
Number of index items scanned per second during queries and query-plan evaluation.
shown as operation
mongodb.metrics.record.movesps
(gauge)
Number of times per second documents move within the on-disk representation of the MongoDB data set.
shown as operation
mongodb.metrics.repl.apply.batches.numps
(gauge)
Number of batches applied across all databases per second.
shown as operation
mongodb.metrics.repl.apply.batches.totalmillisps
(gauge)
Fraction of time (ms/s) the mongod has spent applying operations from the oplog.
shown as fraction
mongodb.metrics.repl.apply.opsps
(gauge)
Number of oplog operations applied per second.
shown as operation
mongodb.metrics.repl.buffer.count
(gauge)
Number of operations in the oplog buffer.
shown as operation
mongodb.metrics.repl.buffer.maxsizebytes
(gauge)
Maximum size of the buffer.
shown as byte
mongodb.metrics.repl.buffer.sizebytes
(gauge)
Current size of the contents of the oplog buffer.
shown as byte
mongodb.metrics.repl.network.bytesps
(gauge)
Amount of data read from the replication sync source per second.
shown as byte
mongodb.metrics.repl.network.getmores.numps
(gauge)
Number of getmore operations per second.
shown as operation
mongodb.metrics.repl.network.getmores.totalmillisps
(gauge)
Fraction of time (ms/s) required to collect data from getmore operations.
shown as fraction
mongodb.metrics.repl.network.opsps
(gauge)
Number of operations read from the replication source per second.
shown as operation
mongodb.metrics.repl.network.readerscreatedps
(gauge)
Number of oplog query processes created per second.
shown as process
mongodb.metrics.repl.preload.docs.numps
(rate)
Number of documents loaded during the pre-fetch stage of replication.
shown as document
mongodb.metrics.repl.preload.docs.totalmillisps
(rate)
Amount of time spent loading documents as part of the pre-fetch stage of replication.
shown as millisecond
mongodb.metrics.repl.preload.indexes.numps
(rate)
Number of index entries loaded by members before updating documents as part of the pre-fetch stage of replication.
shown as document
mongodb.metrics.repl.preload.indexes.totalmillisps
(rate)
Amount of time spent loading documents as part of the pre-fetch stage of replication.
shown as millisecond
mongodb.metrics.ttl.deleteddocumentsps
(gauge)
Number of documents deleted from collections with a ttl index per second.
shown as document
mongodb.metrics.ttl.passesps
(gauge)
Number of times per second the background process removes documents from collections with a ttl index.
shown as operation
mongodb.network.bytesinps
(rate)
The number of bytes that reflects the amount of network traffic received by this database.
shown as byte
mongodb.network.bytesoutps
(rate)
The number of bytes that reflects the amount of network traffic sent from this database.
shown as byte
mongodb.network.numrequestsps
(rate)
Number of distinct requests that the server has received.
shown as request
mongodb.opcounters.commandps
(gauge)
Total number of commands per second issued to the database.
shown as command
mongodb.opcounters.deleteps
(gauge)
Number of delete operations per second.
shown as operation
mongodb.opcounters.getmoreps
(gauge)
Number of getmore operations per second.
shown as operation
mongodb.opcounters.insertps
(gauge)
Number of insert operations per second.
shown as operation
mongodb.opcounters.queryps
(gauge)
Total number of queries per second.
shown as query
mongodb.opcounters.updateps
(gauge)
Number of update operations per second.
shown as operation
mongodb.opcountersrepl.commandps
(gauge)
Total number of replicated commands issued to the database per second.
shown as command
mongodb.opcountersrepl.deleteps
(gauge)
Number of replicated delete operations per second.
shown as operation
mongodb.opcountersrepl.getmoreps
(gauge)
Number of replicated getmore operations per second.
shown as operation
mongodb.opcountersrepl.insertps
(gauge)
Number of replicated insert operations per second.
shown as operation
mongodb.opcountersrepl.queryps
(gauge)
Total number of replicated queries per second.
shown as query
mongodb.opcountersrepl.updateps
(gauge)
Number of replicated update operations per second.
shown as operation
mongodb.oplog.logsizemb
(gauge)
Total size of the oplog.
shown as mebibyte
mongodb.oplog.timediff
(gauge)
Oplog window: difference between the first and last operation in the oplog.
shown as second
mongodb.oplog.usedsizemb
(gauge)
Total amount of space used by the oplog.
shown as mebibyte
mongodb.replset.health
(gauge)
Member health value of the replica set: conveys if the member is up (i.e. 1) or down (i.e. 0).
mongodb.replset.replicationlag
(gauge)
Delay between a write operation on the primary and its copy to a secondary.
shown as second
mongodb.replset.state
(gauge)
State of a replica that reflects its disposition within the set.
mongodb.replset.votefraction
(gauge)
Fraction of votes a server will cast in a replica set election.
shown as fraction
mongodb.replset.votes
(gauge)
The number of votes a server will cast in a replica set election.
shown as item
mongodb.stats.datasize
(gauge)
Total size of the data held in this database including the padding factor.
shown as byte
mongodb.stats.indexes
(gauge)
Total number of indexes across all collections in the database.
shown as index
mongodb.stats.indexsize
(gauge)
Total size of all indexes created on this database.
shown as byte
mongodb.stats.objects
(gauge)
Number of objects (documents) in the database across all collections.
shown as object
mongodb.stats.storagesize
(gauge)
Total amount of space allocated to collections in this database for document storage.
shown as byte
mongodb.uptime
(gauge)
Number of seconds that the mongos or mongod process has been active.
shown as second
mongodb.wiredtiger.cache.bytes_currently_in_cache
(gauge)
Size of the data currently in cache.
shown as byte
mongodb.wiredtiger.cache.failed_eviction_of_pages_exceeding_the_in_memory_maximumps
(gauge)
Number of failed eviction of pages that exceeded the in-memory maximum, per second.
shown as page
mongodb.wiredtiger.cache.in_memory_page_splits
(gauge)
In-memory page splits.
shown as split
mongodb.wiredtiger.cache.maximum_bytes_configured
(gauge)
Maximum cache size.
shown as byte
mongodb.wiredtiger.cache.maximum_page_size_at_eviction
(gauge)
Maximum page size at eviction.
shown as byte
mongodb.wiredtiger.cache.modified_pages_evicted
(gauge)
Number of pages, that have been modified, evicted from the cache.
shown as page
mongodb.wiredtiger.cache.pages_currently_held_in_cache
(gauge)
Number of pages currently held in the cache.
shown as page
mongodb.wiredtiger.cache.pages_evicted_by_application_threadsps
(gauge)
Number of page evicted by application threads per second.
shown as page
mongodb.wiredtiger.cache.pages_evicted_exceeding_the_in_memory_maximumps
(gauge)
Number of pages evicted because they exceeded the cache in-memory maximum, per second.
shown as page
mongodb.wiredtiger.cache.tracked_dirty_bytes_in_cache
(gauge)
Size of the dirty data in the cache.
shown as byte
mongodb.wiredtiger.cache.unmodified_pages_evicted
(gauge)
Number of pages, that were not modified, evicted from the cache.
shown as page
mongodb.wiredtiger.concurrenttransactions.read.available
(gauge)
Number of available read tickets (concurrent transactions) remaining.
shown as ticket
mongodb.wiredtiger.concurrenttransactions.read.out
(gauge)
Number of read tickets (concurrent transactions) in use.
shown as ticket
mongodb.wiredtiger.concurrenttransactions.read.totaltickets
(gauge)
Total number of read tickets (concurrent transactions) available.
shown as ticket
mongodb.wiredtiger.concurrenttransactions.write.available
(gauge)
Number of available write tickets (concurrent transactions) remaining.
shown as ticket
mongodb.wiredtiger.concurrenttransactions.write.out
(gauge)
Number of write tickets (concurrent transactions) in use.
shown as ticket
mongodb.wiredtiger.concurrenttransactions.write.totaltickets
(gauge)
Total number of write tickets (concurrent transactions) available.
shown as ticket
mongodb.collection.size
(gauge)
The total size in bytes of the data in the collection plus the size of every indexes on the mongodb.collection.
shown as byte
mongodb.collection.avgObjSize
(gauge)
The size of the average object in the collection in bytes.
shown as byte
mongodb.collection.count
(gauge)
Total number of objects in the collection.
shown as item
mongodb.collection.capped
(gauge)
Whether or not the collection is capped.
shown as record
mongodb.collection.max
(gauge)
Maximum number of documents in a capped collection.
shown as document
mongodb.collection.maxSize
(gauge)
Maximum size of a capped collection in bytes.
shown as byte
mongodb.collection.storageSize
(gauge)
Total storage space allocated to this collection for document storage.
shown as byte
mongodb.collection.nindexes
(gauge)
Total number of indices on the collection.
shown as index
mongodb.collection.indexSizes
(gauge)
Size of index in bytes.
shown as byte
mongodb.collection.indexes.accesses.ops
(gauge)
Number of time the index was used.
shown as event
mongodb.usage.commands.countps
(rate)
Number of commands per second
shown as command
mongodb.usage.commands.count
(gauge)
Number of commands since server start (deprecated)
shown as command
mongodb.usage.commands.time
(gauge)
Total time spent performing commands in microseconds
shown as microsecond
mongodb.usage.getmore.countps
(rate)
Number of getmore per second
shown as fetch
mongodb.usage.getmore.count
(gauge)
Number of getmore since server start (deprecated)
shown as fetch
mongodb.usage.getmore.time
(gauge)
Total time spent performing getmore in microseconds
shown as microsecond
mongodb.usage.insert.countps
(rate)
Number of inserts per second
shown as commit
mongodb.usage.insert.count
(gauge)
Number of inserts since server start (deprecated)
shown as commit
mongodb.usage.insert.time
(gauge)
Total time spent performing inserts in microseconds
shown as microsecond
mongodb.usage.queries.countps
(rate)
Number of queries per second
shown as query
mongodb.usage.queries.count
(gauge)
Number of queries since server start (deprecated)
shown as query
mongodb.usage.queries.time
(gauge)
Total time spent performing queries in microseconds
shown as microsecond
mongodb.usage.readLock.countps
(rate)
Number of read locks per second
shown as lock
mongodb.usage.readLock.count
(gauge)
Number of read locks since server start (deprecated)
shown as lock
mongodb.usage.readLock.time
(gauge)
Total time spent performing read locks in microseconds
shown as microsecond
mongodb.usage.remove.countps
(rate)
Number of removes per second
shown as commit
mongodb.usage.remove.count
(gauge)
Number of removes since server start (deprecated)
shown as commit
mongodb.usage.remove.time
(gauge)
Total time spent performing removes in microseconds
shown as microsecond
mongodb.usage.total.countps
(rate)
Number of operations per second
shown as command
mongodb.usage.total.count
(gauge)
Number of operations since server start (deprecated)
shown as command
mongodb.usage.total.time
(gauge)
Total time spent performing operations in microseconds
shown as microsecond
mongodb.usage.update.countps
(rate)
Number of updates per second
shown as commit
mongodb.usage.update.count
(gauge)
Number of updates since server start (deprecated)
shown as commit
mongodb.usage.update.time
(gauge)
Total time spent performing updates in microseconds
shown as microsecond
mongodb.usage.writeLock.countps
(rate)
Number of write locks per second
shown as lock
mongodb.usage.writeLock.count
(gauge)
Number of write locks since server start (deprecated)
shown as lock
mongodb.usage.writeLock.time
(gauge)
Total time spent performing write locks in microseconds
shown as microsecond

See the MongoDB 3.0 Manual for more detailed descriptions of some of these metrics.

NOTE: The following metrics are NOT collected by default:

metric prefix what to add to additional_metrics to collect it
mongodb.collection collection
mongodb.commands top
mongodb.getmore top
mongodb.insert top
mongodb.queries top
mongodb.readLock top
mongodb.writeLock top
mongodb.remove top
mongodb.total top
mongodb.update top
mongodb.writeLock top
mongodb.tcmalloc tcmalloc
mongodb.metrics.commands metrics.commands

Events

Replication state changes:

This check emits an event each time a Mongo node has a change in its replication state.

Service Checks

mongodb.can_connect:

Returns CRITICAL if the Agent cannot connect to MongoDB to collect metrics, otherwise OK.

Troubleshooting

Need help? Contact Datadog Support.

Further Reading

Read our series of blog posts about collecting metrics from MongoDB with Datadog:

  • Start here if you’re using the WiredTiger storage engine.
  • Start here if you’re using MMAPv1 storage engine.


Mistake in the docs? Feel free to contribute!