SPM Agent for MongoDB (v3.0.4) is a monitoring agent that collects and reports MongoDB metrics to Sematext Cloud (APM). It supports MongoDB clusters, replica sets, and standalone instances, providing real-time visibility into performance, queries, connections, and disk usage. The agent runs as a system service and requires Node.js and admin privileges (ClusterAdmin role) to access MongoDB internal metrics. Key differentiators include seamless integration with Sematext's monitoring stack, support for Kerberos authentication, Docker deployment via SPM-Client image, and automatic anomaly detection. It is released regularly but no fixed cadence is published.
npm install spm-agent-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs the agent globally, configures it with a Sematext token and MongoDB URL, then starts the monitoring agent as a service or interactive process.
Grant clusterMonitor role or clusterAdmin and read on any database to the MongoDB user used by the agent.
Install libkrb5-dev via apt-get before npm install: apt-get install libkrb5-dev
Migrate from old config (e.g., /etc/spm-agent-mongodb.cfg) to new location and format.
Deploy multiple Docker containers for different MongoDB endpoints.
Backup /etc/sematext/spm-agent-mongodb.config before running spm-mongodb-setup again.
If using Sematext EU, run 'sudo spm-mongodb-setup -r EU' to configure EU API endpoints.
Ensure the MongoDB user has clusterMonitor and read on any database roles.
Install build-essential: sudo apt-get install build-essential