Docs » Available host and application monitors » Configure application receivers for databases » MongoDB

MongoDB ๐Ÿ”—

Description ๐Ÿ”—

The Splunk Distribution of OpenTelemetry Collector provides this integration as the MongoDB monitor using the Smart Agent Receiver.

This monitor captures the following metrics about MongoDB:

  • Memory

  • Network input/output bytes count

  • Heap usage

  • DB connections

  • Operations count

  • Active client connections

  • Queued operations

The plugin also captures the following DB-specific metrics:

  • DB size

  • DB counters

This monitor is available on Kubernetes, Linux, and Windows.

Benefits ๐Ÿ”—

After you configure the integration, you can access these features:

Installation ๐Ÿ”—

Follow these steps to deploy this integration:

  1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:

  2. Configure the monitor, as described in the Configuration section.

  3. Restart the Splunk Distribution of OpenTelemetry Collector.

Authentication ๐Ÿ”—

If youโ€™re monitoring a secured MongoDB deployment, create a MongoDB user with minimal read-only roles, as follows:

db.createUser( {
  user: "<username>",
  pwd: "<password>",
  roles: [ { role: "readAnyDatabase", db: "admin" }, { role: "clusterMonitor", db: "admin" } ]
});

Note

Only SCRAM-SHA-1 authentication is supported.

Configuration ๐Ÿ”—

This monitor type is available in the Smart Agent Receiver, which is part of the Splunk Distribution of OpenTelemetry Collector. You can use existing Smart Agent monitors as OpenTelemetry Collector metric receivers with the Smart Agent Receiver.

This monitor type requires a properly configured environment on your system in which youโ€™ve installed a functional Smart Agent release bundle. The Collector provides this bundle in the installation paths for x86_64/amd64.

To activate this monitor type in the Collector, add the following lines to your configuration (YAML) file:

Note

OnlyProviding a MongoDB monitor entry in your Smart Agent or Collector configuration is required for its use. Use the appropriate form for your agent type. SCRAM-SHA-1 authentication is supported.

Splunk Distribution of OpenTelemetry Collector ๐Ÿ”—

To activate this monitor in the Splunk Distribution of OpenTelemetry Collector, add the following to your agent configuration:

receivers:
  smartagent/mongodb:
    type: collectd/mongodb
    ...  # Additional config

To complete the monitor activation, you must also include the smartagent/mongodb receiver item in a metrics pipeline. To do this, add the receiver item to the service > pipelines > metrics > receivers section of your configuration file. For example:

service:
  pipelines:
    metrics:
      receivers: [smartagent/mongodb]

Smart Agent ๐Ÿ”—

To activate this monitor in the Smart Agent, add the following to your agent configuration:

monitors:  # All monitor config goes under this key
 - type: collectd/mongodb
   ...  # Additional config

See Install and configure the SignalFx Smart Agent for an autogenerated example of a YAML configuration file, with default values where applicable.

Configuration settings ๐Ÿ”—

The following table shows the configuration options for the MongoDB monitor:

Option

Required

Type

Description

pythonBinary

No

string

Path to the Python binary. If not set, a built-in runtime is used. This setting can include arguments to the binary.

host

Yes

string

Hostname or IP address of the MongoDB instance.

port

Yes

integer

Port of the MongoDB instance. The default value is 27017.

databases

Yes

list of strings

Name of the databases you want to monitor. The first database in this list must be admin, as itโ€™s used to perform a serverStatus() call.

username

No

string

MongoDB user.

password

No

string

Password of the user defined in username.

useTLS

No

bool

If true, the monitor connects to MongoDB using TLS. The default value is false.

caCerts

No

string

Path to a CA cert used to verify the certificate that MongoDB presents. Not needed if not using TLS or if MongoDBโ€™s certificate is signed by a globally trusted issuer already installed in the default location on your system.

tlsClientCert

No

string

Path to a client certificate. Not needed unless your MongoDB instance requires x509 client verification.

tlsClientKey

No

string

Path to a client certificate key. Not needed unless your MongoDB instance requires x509 client verification, or if your client certificate defined in tlsClientCert includes the key.

tlsClientKeyPassPhrase

No

string

Passphrase for the TLS client key defined in tlsClientKey.

sendCollectionMetrics

No

bool

Whether to send collection level metrics or not. The default value is false.

sendCollectionTopMetrics

No

bool

Whether to send collection level top timing metrics or not. The default value is false.

Note

When using TLS authentication, SCRAM-SHA-256 is not supported. Use SCRAM-SHA-1 authentication.

Metrics ๐Ÿ”—

The following metrics are available for this integration:

Get help ๐Ÿ”—

If you are not able to see your data in Splunk Observability Cloud, try these tips:

To learn about even more support options, see Splunk Customer Success.