WARNING: Version 6.1 of Metricbeat has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
This module periodically fetches metrics from MongoDB servers.
Module-specific configuration notesedit
When configuring the
hosts option, you must use MongoDB URLs of the following
The URL can be as simple as:
- module: mongodb hosts: ["localhost"]
Or more complex like:
- module: mongodb hosts: ["mongodb://myuser:mypass@localhost:40001", "otherhost:40001"]
The username and password can be included in the URL or they can be set using the respective configuration options. The credentials in the URL take precedence over the username and password configuration options.
- module: mongodb metricsets: ["status"] hosts: ["localhost:27017"] username: root password: test
The MongoDB metricsets were tested with MongoDB 3.4 and 3.0 and are expected to work with all versions >= 2.8.
The MongoDB module supports the standard configuration options that are described in Specify which modules to run. Here is an example configuration:
metricbeat.modules: - module: mongodb metricsets: ["dbstats", "status"] period: 10s # The hosts must be passed as MongoDB URLs in the format: # [mongodb://][user:pass@]host[:port]. # The username and password can also be set using the respective configuration # options. The credentials in the URL take precedence over the username and # password configuration options. hosts: ["localhost:27017"] # Username to use when connecting to MongoDB. Empty by default. #username: user # Password to use when connecting to MongoDB. Empty by default. #password: pass
The following metricsets are available: