What you’ll need
- MongoDB Atlas API Public Key
- MongoDB Atlas API Private Key
- Atlas Project ID
- Permissions to view cluster metrics and configuration
Getting connected
Quick setup: Interactive mode
Let’s walk through it step by step:DIY mode: Environment variables
Prefer manual config? Add these to your.env:
Option 3: Persistent store
Finding your Atlas API credentials
- Log in to MongoDB Atlas
- Navigate to Access Manager → API Keys
- Create a Project API Key
- Copy the Public Key
- Copy the Private Key
- Locate your Project ID from the Atlas project settings
This integration uses the Atlas Admin API, not a MongoDB connection string. Create a Project API key with read access to cluster metrics and alerts.
Investigation tools
When OpenSRE investigates a MongoDB Atlas-related alert, these tools query the Atlas Admin API:Clusters
Lists all clusters in the project — state, MongoDB version, instance size, and replication topology.Metrics
Retrieves performance metrics for a cluster (CPU, disk I/O, connections, opcounters).Alerts
Fetches open Atlas alerts including event type, affected cluster, and current metric values.Events
Returns recent project events such as cluster scaling, backup completions, and maintenance windows.Performance advisor
Surfaces Atlas Performance Advisor recommendations for slow queries and missing indexes.Verify it works
Let’s make sure everything’s connected:Troubleshooting
Security best practices
- Create a dedicated Atlas API key for OpenSRE with the minimum project role required.
- Rotate API keys periodically and revoke unused keys.
- Never commit API keys to source control — use
.envor the integration store.