MongoDB agent
Prerequisites
- For prerequisite checks for agent installation, see Prerequisite checks for agent installation.
- URL/IP of the SixthSense collector (your tenant URL, which will be provided by Customer Support).
- Access token from the SixthSense portal. For accessing the token, see Accessing your Access Token under Getting started with the Observability Portal.
- MongoDB agent version "latest".
- Package token to download agent (provided by the onboarding team).
- For information about supported agent versions and framework, see Supported agents.
Downloading the agent version 4.4.5 (latest)
For Windows and Linux based servers, use the following link.
Configuring the MongoDB agent
Create a config.yaml file in the same directory.
sixthsense-mongodb-agent can be configured via yaml or environment variables. Following is the yaml file for configuring.
note
Environment variables are given higher priority over yaml file
To enable the query on the mongodb database, perform the following:
- Login to the container or DB. “Docker exec it mongo1 mongosh”
- Use the DB on the dashboard from where you will get the query.
- Use the following command to start Log operation for storing slow queries in “system.profile” with threshold time 0 =>
System.Profile:
The system.profile collection is used to log detailed information about database operations, including their execution time, query patterns, and resource usage.It is primarily used for performance monitoring and debugging.
Profiling Levels:
MongoDB provides three profiling levels that determine what kind of operations are logged in the system.profile collection:
- 0 (Off): Profiling is disabled (default setting). No operations are logged.
- 1 (Slow Operations): Only operations that take longer than a specified threshold (in milliseconds) are logged. The threshold is set using the slowms parameter.
- 2 (All Operations): All operations are logged, regardless of their execution time.
Running the agent
For Linux:
Use the following command to run the agent.
For Windows:
- Register DBM agent as a Service in Windows. Type in the following command in cmd:
Example:
Confirm whether the service is registered by opening Services and search for the Service Name with which you've registered.
Run the service by opening the Services again and look for Service name > Start or sc start <service_name>.
Example: sc start MeterAgent_mongodb