MongoDb

Overview

This plugin collects runtime metrics from MongoDb database. It gathers information about connections, performed operations counters, memory and network statistics, etc.

Note

This plugin is currently available for x86_64 Linux and Windows platforms.

Setup

The mongodb plugin is included with the SolarWinds Snap Agent by default, please follow the directions below to enable it for a agent instance.

Prerequisites

This plugin may require credentials to gather status information from MongoDb instance (depending on security.authorization option). Please refer to your database manual how to set up credentials.

Configuration

The agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your database. To enable the plugin:

  1. Make a copy of the mongodb example configuration file /opt/SolarWinds/Snap/etc/plugins.d/mongodb.yaml.example, renaming it to /opt/SolarWinds/Snap/etc/plugins.d/mongodb.yaml:
$ sudo cp /opt/SolarWinds/Snap/etc/plugins.d/mongodb.yaml.example /opt/SolarWinds/Snap/etc/plugins.d/mongodb.yaml
  1. Update the /opt/SolarWinds/Snap/etc/plugins.d/mongodb.yaml configuration file with settings specific to your database instance, for example:
collector:
  mongodb:
    all:
      uri: "192.168.56.121:27017"
      username: "admin"
      password: "password"

load:
  plugin: snap-plugin-collector-aomongodb
  task: task-aomongodb.yaml

Note

  • uri specifies IP and port on which to connect with MongoDb instance
  • username
    • if security.authorization is enabled this field should contain valid username created within MongoDb (with clusterMonitor or admin role)
    • if security.authorization is disabled this field should remain empty
  • password
    • if security.authorization is enabled this field should contain valid password associated with username
    • if security.authorization is disabled this field should remain empty
  1. Restart the agent:
$ sudo service swisnapd restart
  1. Enable the MongoDb plugin in the AppOptics UI

On the Integrations Page you will see the MongoDb plugin available if the previous steps were successful. If you do not see the plugin, see Troubleshooting.

Select the MongoDb plugin to open the configuration menu in the UI, and enable the plugin.

You should soon see the mongodb metrics reported to your dashboard.

Metrics and Tags

The tables below outline the default set of metrics collected by the mongodb plugin along with the optional metrics available.

Note

All metrics are int64 values collected either as a counter, gauge or derivative.

Note

MongoDb collector utilizes output of db.serverStatus() command. To see full description of specific field visit documentation MongoDb serverStatus.

Ie. to see explanation of /mongodb/connections/available metric visit: https://docs.mongodb.com/manual/reference/command/serverStatus/#serverstatus.connections.available.

For database metrics group output of db.dbStats() is used. To see full description of specific field visit documentation MongoDb dbStats.

Default Metrics

Namespace Description
/mongodb/opscounters/command number of “command” operations performed (counted since mongodb has started)
/mongodb/opscounters/delete number of “delete” operations performed (counted since mongodb has started)
/mongodb/opscounters/getmore number of “getmore” operations performed (counted since mongodb has started)
/mongodb/opscounters/insert number of “insert” operations performed (counted since mongodb has started)
/mongodb/opscounters/query number of “query” operations performed (counted since mongodb has started)
/mongodb/opscounters/update number of “update” operations performed (counted since mongodb has started)
/mongodb/tmalloc/aggressive_memory_decommit status of aggressive memory decommit mode
/mongodb/tmalloc/central_cache_free_bytes number of free bytes in the central cache
/mongodb/tmalloc/current_allocated_bytes number of bytes used by the application
/mongodb/tmalloc/current_total_thread_cache_bytes number of bytes used across all thread caches
/mongodb/tmalloc/heap_size bytes of system memory reserved for allocation
/mongodb/tmalloc/max_total_thread_cache_bytes upper limit on total number of bytes stored across all per-thread caches
/mongodb/tmalloc/pageheap_free_bytes number of bytes in free, mapped pages in page heap
/mongodb/tmalloc/pageheap_unmapped_bytes number of bytes in free, unmapped pages in page heap that have been released to OS
/mongodb/tmalloc/thread_cache_free_bytes number of free bytes in thread caches
/mongodb/tmalloc/total_free_bytes total number of free bytes across all caches
/mongodb/tmalloc/transfer_cache_free_bytes number of free bytes that are waiting to be transfered between the central cache and a thread cache

Default Metric Tags

All MongoDb metrics are tagged with hostname. Instead of using that tag, we recommend using the @host alias.

Optional Metrics

Optinal metrics can be activated by editing the task yaml. For more information please read the SolarWinds Snap Agent configuration article.

Namespace Description
/mongodb/connections/available number of available sessions that could still be opened
/mongodb/connections/current number of sessions currently open in the transport layer
/mongodb/connections/totalcreated total number of sessions that have ever been created by the transport layer
/mongodb/database/*/collections contains a count of the number of collections in specific database
/mongodb/database/*/data_size the total size of the uncompressed data held in this database
/mongodb/database/*/indexes contains a count of the total number of indexes across all collections in the database
/mongodb/database/*/index_size the total size of all indexes created on this database
/mongodb/database/*/objects contains a count of the number of objects (i.e. documents) in the database across all collections
/mongodb/database/*/storage_size the total amount of space allocated to collections in this database for document storage
/mongodb/database/*/views the number of views created on this database
/mongodb/extrainfo/heap_usage_bytes (experimental)
/mongodb/extrainfo/page_faults number of page faults experienced by application
/mongodb/memory/bits basic size of allocation (bit)
/mongodb/memory/mapped amount of virtual memory used to map the database into memory (MB)
/mongodb/memory/mappedwithjournal amount of virtual memory for database including mapped files (MB)
/mongodb/memory/resident amount of memory used by the application (MB)
/mongodb/memory/supported flag if memory info is supported
/mongodb/memory/virtual virtual memory usage (MB)
/mongodb/metrics/document_deleted total number of documents deleted
/mongodb/metrics/document_inserted total number of documents inserted
/mongodb/metrics/document_returned total number of documents returned
/mongodb/metrics/document_updated total number of documents updated
/mongodb/metrics/operation_fastmod number of update operations that neither cause documents to grow nor require updates to the index
/mongodb/metrics/operation_idhack number of queries that contain the _id field
/mongodb/metrics/operation_scanandorder total number of queries that return sorted numbers that cannot perform the sort operation using an index
/mongodb/metrics/operation_write_conflicts total number of queries that encounted write conflicts
/mongodb/metrics/queryexecutor_scanned total number of index items scanned during queries and query-plan evaluation
/mongodb/metrics/queryexecutor_scannedobjects total number of documents scanned during queries and query-plan evaluation
/mongodb/metrics/record_moves reports the total number of times documents move within the on-disk representation of the MongoDB data set
/mongodb/metrics/repl_apply_batches_totalmillis counts batches total execution time
/mongodb/metrics/repl_apply_batchesnum counts executed batches
/mongodb/metrics/repl_apply_ops number of oplog entries applied
/mongodb/metrics/repl_buffer_count count of items in the buffer
/mongodb/metrics/repl_buffer_maxsizebytes max size of the buffer (bytes)
/mongodb/metrics/repl_buffer_sizebytes size of items in the buffer (bytes)
/mongodb/metrics/repl_executor_counters_cancels number of canceled replication events
/mongodb/metrics/repl_executor_counters_eventcreated number of created replication events
/mongodb/metrics/repl_executor_counters_eventwait number of created replication events
/mongodb/metrics/repl_executor_counters_scheduleddbwork number of scheduled db-work operations
/mongodb/metrics/repl_executor_counters_schedulednetcmd number of scheduled remote operations
/mongodb/metrics/repl_executor_counters_scheduledwork number of additional scheduled operations
/mongodb/metrics/repl_executor_counters_scheduledworkat number of delayed scheduled operations
/mongodb/metrics/repl_executor_counters_scheduledxclwork number of operations scheduled under exclusive lock
/mongodb/metrics/repl_executor_counters_schedulingfailures number of failed scheduling attempts
/mongodb/metrics/repl_executor_counters_waits number of replication waits
/mongodb/metrics/repl_executor_eventwaiters counts threads awaiting for events to be signaled
/mongodb/metrics/repl_executor_queues_dbworkinprogress number of scheduled db-work operations pending execution
/mongodb/metrics/repl_executor_queues_exclusiveinprogress number of scheduled pending operations requiring exclusive lock
/mongodb/metrics/repl_executor_queues_free (experminental)
/mongodb/metrics/repl_executor_queues_networkinprogress number of remote scheduled commands blocked on the network
/mongodb/metrics/repl_executor_queues_ready counts queued operations ready for execution
/mongodb/metrics/repl_executor_queues_sleepers counts operations waiting for a timer
/mongodb/metrics/repl_executor_unsignaledevents counts events that have yet to be signaled
/mongodb/metrics/repl_network_bytes bytes read via the oplog reader
/mongodb/metrics/repl_network_getmores_num number of times reading batches off the network
/mongodb/metrics/repl_network_getmores_totalmillis time spent reading batches off the network
/mongodb/metrics/repl_network_ops oplog entries read via the oplog reader
/mongodb/metrics/repl_network_readerscreated number of readers created
/mongodb/metrics/repl_pcursor_open_notimeout number of cursors not timed out
/mongodb/metrics/repl_pcursor_open_pinned number of open pinned cursors
/mongodb/metrics/repl_pcursor_open_total total number of open cursors
/mongodb/metrics/repl_pcursor_timedout number of timed out cursors
/mongodb/metrics/repl_preload_docs_num count (of batches) spent fetching pages before application
/mongodb/metrics/repl_preload_docs_totalmillis time spent fetching pages before application
/mongodb/metrics/repl_preload_indexes_totalmillis time spent fetching index before application
/mongodb/metrics/repl_preload_indexesnum count (of batches) spent fetching index before application
/mongodb/metrics/storage_freelist_search_bucketexhausted number of times that mongod has checked the free list without finding a suitably large record allocation
/mongodb/metrics/storage_freelist_search_requests number of times mongod has searched for available record allocations
/mongodb/metrics/storage_freelist_search_scanned number of available record allocations mongod has searched
/mongodb/metrics/ttl_deleteddocuments total number of documents deleted from collections with a ttl index
/mongodb/metrics/ttl_passes number of times the background process removes documents from collections with a ttl index
/mongodb/network/bytesin number of bytes in received requests
/mongodb/network/bytesout number of bytes in emitted responses
/mongodb/network/numrequests number of received requests