Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Relic Solution: The MongoDB On-Host Integration



The Mongo OnHost Integration is one of the Integrations that works with the Infrastructure Agent.

Getting the integration working properly and reporting on the desired data can be tricky.

Essentially, there are two types of data that can be retrieved from this integration: MongoD and MongoS.

From our documentation:

Different metrics are available depending on whether a sharded cluster(mongoS) or a standalone(mongoD) instance is being monitored. For a standalone instance, only MongodSample, MongoDatabaseSample, MongoTopSample and MongoCollectionSample are collected. For a cluster, all event types are collected.

The MongoDB integration can monitor either sharded ( mongos) or stand-alone (mongod ) instances.

Currently, the integration dashboard is built around metrics that are collected primarily from sharded instances, so many of the charts in the dashboard won’t be populated if you’re just monitoring a standalone instance. If your cluster is a stand-alone instance with replicas, only metrics from a stand-alone instance will be collected.

You can tell if your instance is standalone ( mongod ) or sharded ( mongos ) from the output of the following command:

mongo --eval 'printjson(db.runCommand( { serverStatus: 1 } ))'

This will return JSON like the following:

“host” : “host”,
“advisoryHostFQDNs” : [
“version” : “3.2.18”,
“process” : “mongod”,

Running the integration manually

Running the integration manually outside of the Infra agent can reveal additional details about the connection and metrics. The arguments are just the configuration values from here. Here’s how to run it from the command line:

/var/db/newrelic-infra/newrelic-integrations/bin/nr-mongodb -host host -cluster_name my_cluster -port port -username: username -password password -auth_source auth source -ssl true or false

Hope this is helpful. Please let me know if you have any feedback for me.