Skip to main content
Databases in the cloud can be harder to troubleshoot. That’s where OpenSRE comes in. Connect to your MongoDB Atlas cluster to get instant visibility into cluster health, performance metrics, slow queries, and replica set status when alerts fire.

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:
Choose MongoDB Atlas and enter your Atlas API credentials when prompted.

DIY mode: Environment variables

Prefer manual config? Add these to your .env:

Option 3: Persistent store

Finding your Atlas API credentials

  1. Log in to MongoDB Atlas
  2. Navigate to Access Manager → API Keys
  3. Create a Project API Key
  4. Copy the Public Key
  5. Copy the Private Key
  6. 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:
Expected output:

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 .env or the integration store.