Supported Platforms

PlatformMetricsLogsTraces
Linux
Windows
macOS

Prerequisites

This source supports MongoDB versions 2.6, 3.x, 4.x, and 5.0.

Configuration Table

ParameterTypeDefaultDescription
enable_metricsbooltrueEnable to collect metrics.
hostsstrings"localhost:27017"List of host:port or unix domain socket endpoints. \n \n- For standalone MongoDB deployments this is the hostname and port of the mongod instance.\n- For replica sets specify the hostnames and ports of the mongod instances that are in the replica set configuration. If the replica_set field is specified, nodes will be autodiscovered.\n- For a sharded MongoDB deployment, please specify a list of the mongos hosts.
usernamestringIf authentication is required, specify a username with "clusterMonitor" permission.
passwordstringThe password user's password.
collection_intervalint60How often (seconds) to scrape for metrics.
enable_tlsboolfalseWhether or not to use TLS.
insecure_skip_verifyboolfalseEnable to skip TLS certificate verification.
ca_filestringCertificate authority used to validate the database server's TLS certificate.
cert_filestringA TLS certificate used for client authentication, if mutual TLS is enabled.
key_filestringA TLS private key used for client authentication, if mutual TLS is enabled.
enable_logsbooltrueEnable to collect logs.
log_pathsstrings- \"/var/log/mongodb/mongodb.log_\" \n - \"/var/log/mongodb/mongod.log_\"Path to Mongodb log file(s).
start_atenumendStart reading file from 'beginning' or 'end'.