Docs » Supported integrations in Splunk Observability Cloud » Collector components: Receivers » MongoDB receiver

MongoDB receiver 🔗

The MongoDB receiver fetches metrics from standalone MongoDB clusters, including non-Atlas managed MongoDB servers. The supported pipeline type is metrics. See Process your data with pipelines for more information.

The receiver collects stats with MongoDB’s dbStats and serverStatus commands, and uses the golang mongo driver. See more at Mongo Go driver documentation .

Note

Out-of-the-box dashboards and navigators aren’t supported for the MongoDB receiver yet, but are planned for a future release.

Prerequisites 🔗

The MongoDB receiver supports MongoDB versions 4.0+ and 5.0.

MongoDB recommends to set up a least privilege user (LPU) with a clusterMonitor role in order to collect metrics.

Note

If you’re using automatic discovery with MongoDB, see Automatic discovery for MongoDB.

Get started 🔗

Follow these steps to configure and activate the component:

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

  2. Configure the receiver as described in the next section.

  3. Restart the Collector.

Sample configurations 🔗

To activate the MongoDB receiver, add mongodb to the receivers section of your configuration file, as shown in the following example:

receivers:
  mongodb:
    hosts:
      - endpoint: localhost:27017
        transport: tcp
    username: otel
    password: ${env:MONGODB_PASSWORD}
    collection_interval: 60s
    initial_delay: 1s
    tls:
      insecure: true
      insecure_skip_verify: true

To complete the configuration, include the receiver in the metrics pipeline of the service section of your configuration file. For example:

service:
  pipelines:
    metrics:
      receivers: [mongodb]

Configuration options 🔗

The following settings are optional:

  • hosts. [localhost:27017] by default. List of host:port or Unix domain socket endpoints.

    • For standalone MongoDB deployments this is the hostname and port of the mongod instance.

    • 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.

    • For a sharded MongoDB deployment, specify a list of the mongos hosts.

  • username: If authentication is required, provide the clusterMonitor permissions here.

  • password: If authentication is required, provide the password here.

  • collection_interval. 1m by default. This receiver collects metrics on an interval. Valid time units are ns, us (or µs), ms, s, m, h. This value must be a string readable by Golang’s time parseDuration. Learn more at ParseDuration .

  • initial_delay. 1s by default. Defines how long this receiver waits before starting.

  • replica_set: If the deployment of MongoDB is a replica set, use this to specify the replica set name which allows for autodiscovery of other nodes in the replica set.

  • timeout. 1m by default. The timeout of running commands against mongo.

  • tls: TLS control. By default insecure settings are rejected and certificate verification is on. See more at TLS Configuration Settings .

Settings 🔗

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

Metrics 🔗

The following metrics, resource attributes, and attributes are available.

  • mongodb.extent.count is available for versions under 4.4 with mmapv1 storage engine.

Activate or deactivate specific metrics 🔗

You can activate or deactivate specific metrics by setting the enabled field in the metrics section for each metric. For example:

receivers:
  samplereceiver:
    metrics:
      metric-one:
        enabled: true
      metric-two:
        enabled: false

The following is an example of host metrics receiver configuration with activated metrics:

receivers:
  hostmetrics:
    scrapers:
      process:
        metrics:
          process.cpu.utilization:
            enabled: true

Note

Deactivated metrics aren’t sent to Splunk Observability Cloud.

Troubleshooting 🔗

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers .

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.

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