MongoDB Atlas¶
By enabling this toolset, HolmesGPT can access MongoDB Atlas projects and processes to analyze logs, alerts, events, slow queries, and various metrics to understand the state of MongoDB projects.
Warning
This toolset is in Experimental stage.
Prerequisites¶
- MongoDB Atlas account
- MongoDB Atlas API keys (Public and Private)
- MongoDB Atlas project ID
- Appropriate MongoDB Atlas permissions
Configuration¶
First, set the following environment variables:
export MONGODB_ATLAS_PUBLIC_KEY="<your-public-api-key>"
export MONGODB_ATLAS_PRIVATE_KEY="<your-private-api-key>"
export MONGODB_ATLAS_PROJECT_ID="<your-project-id>"
Then add the following to ~/.holmes/config.yaml, creating the file if it doesn't exist:
holmes:
additionalEnvVars:
- name: MONGODB_ATLAS_PUBLIC_KEY
value: "<your-public-api-key>"
- name: MONGODB_ATLAS_PRIVATE_KEY
value: "<your-private-api-key>"
- name: MONGODB_ATLAS_PROJECT_ID
value: "<your-project-id>"
toolsets:
MongoDBAtlas:
enabled: true
config:
public_key: "<your-public-api-key>"
private_key: "<your-private-api-key>"
project_id: "<your-project-id>"
Setting up MongoDB Atlas API Keys¶
- Log into MongoDB Atlas and navigate to your organization
- Go to Access Manager → API Keys
- Create a new API key:
- Set appropriate permissions for your use case
- Copy the public key and private key
- Get your Project ID:
- Navigate to your project
- Copy the Project ID from the project settings
Required Permissions¶
The API key requires the following permissions:
- Project Read Only - To read project information
- Project Data Access Admin - To access database logs and metrics
- Project Monitoring Admin - To access monitoring data and alerts
Capabilities¶
Tool Name | Description |
---|---|
atlas_return_project_alerts | Get alerts for the MongoDB Atlas project |
atlas_return_project_processes | Get information about processes in the project |
atlas_return_project_slow_queries | Get slow queries from the project (last 24 hours) |
atlas_return_events_from_project | Get events from the project (last 24 hours) |
atlas_return_logs_for_host_in_project | Get logs for a specific host in the project |
atlas_return_event_type_from_project | Get events of a specific type from the project |
Usage Guidelines¶
Performance Analysis¶
When investigating performance issues:
- Start with alerts and events: Use
atlas_return_project_alerts
andatlas_return_events_from_project
first to identify known issues - Check slow queries: Use
atlas_return_project_slow_queries
to identify performance bottlenecks - Review logs: Use
atlas_return_logs_for_host_in_project
for detailed log analysis
Time Range Limitations¶
atlas_return_project_slow_queries
returns data from the last 24 hours onlyatlas_return_events_from_project
returns data from the last 24 hours only- If you need data from a different time range, the toolset will inform you it's not currently supported
Query Analysis¶
- When analyzing slow queries, the toolset will show the actual query text for every slow query
- For requests asking for a specific number of slow queries (e.g., "top 10 slow queries"), the toolset will not duplicate queries from different processes
Troubleshooting¶
Common Issues¶
- Authentication Failures
- Verify your API keys are correct
- Check that the API key has appropriate permissions
-
Ensure the project ID is correct
-
Permission Errors
- Verify the API key has the required permissions listed above
-
Check that the key is associated with the correct organization
-
No Data Returned
- Verify the project ID is correct
- Check that there are active processes in the project
- Ensure the time range contains relevant data
API Rate Limits¶
MongoDB Atlas API has rate limits. If you encounter rate limiting:
- Wait before making additional requests
- Consider the frequency of your queries
- Check MongoDB Atlas documentation for current rate limits