MongoDB Atlas

The MongoDB Atlas Integration allows you to ingest performance, health, and operational metrics from your MongoDB Atlas clusters. This enables monitoring of connections, operations, replication lag, memory usage, disk I/O, and more.

Prerequisites

  • An active MongoDB Atlas account with an M10 or higher tier cluster. The free tier (M0) does not provide access to the required metrics API endpoints.

Important: You must whitelist the IP address 48.217.209.253 in your MongoDB Atlas API key access list. This IP is used by Middleware to collect metrics from your MongoDB Atlas clusters. Note that this IP address is subject to change. If you notice that metrics are not being collected, please contact the Middleware support team at [email protected] to verify the current IP address.

Configuration

MongoDB Atlas is integrated using the MongoDB Atlas API. You'll need to create an API Key in MongoDB Atlas and configure it in the Middleware platform.

API-Based Authentication

To set up the integration, you'll need to create an API Key in MongoDB Atlas with the following permission:

  • Organization Read Only

These permission is required to access metrics, logs, and events data from your MongoDB Atlas clusters.

Create MongoDB Atlas API Key

  1. Log in to MongoDB Atlas
  2. Navigate to "Identity & Access" > Applications > API Keys
  3. Click "Add New"
  4. Add a description for your key
  5. Under "Organization Permissions", select "Organization Read Only"
  6. Click "Next"
  7. Copy both the Public Key and Private Key and store them securely (you won't be able to access the private key later)
  8. Add IP address 48.217.209.253 to the API access list
  9. Click "Create API Key"

Verify API Key Access

You can verify your API key has the correct permissions by testing the following endpoints:

Replace <PUBLIC_KEY>, <PRIVATE_KEY>, <PROJECT_ID>, and <CLUSTER_NAME> with your actual values.

Required Fields

  • Public Key – Your MongoDB Atlas API public key.
  • Private Key – Your MongoDB Atlas API private key.
  • Collection Interval (Optional) – The frequency at which data is collected. The default interval is 3m.
  • Granularity - The default is PT1M.
  • Storage - The default is file_storage. These values must be entered into the integration form in the Middleware UI to enable the MongoDB Atlas Integration.

Projects (Optional)

  • Project Name: Name of your project
  • Include Clusters / Exclude Clusters: You can choose to specify either what clusters to include or what clusters to exclude. (Not both at once)

Access Integrations

Step 1: Access MongoDB Atlas Integration

Log in to Middleware, navigate to Installations Page in the bottom left corner, select All Integrations, and click on MongoDB Atlas.

MongoDB Atlas Access Screen

Step 2: Configure MongoDB Atlas Integration

  • Public Key: Your Atlas public API key.
  • Private Key: Your Atlas private API key.
  • Collection Interval: Set as needed (default is 3m).
  • Granularity: PT1M
  • Storage: file_storage
  • Projects (Optional):
    • Project Name : Name of your project
    • Include Clusters / Exclude Clusters : You can choose to specify either which clusters to include or which clusters to exclude. (Not both at once)
MongoDB Atlas Configuration Screen

Conclusion

Once configured, Middleware will securely connect to MongoDB Atlas using the API and begin collecting real-time metrics for analysis and alerts.

Visualize Analytics

Default MongoDB Atlas Dashboard

A pre-built dashboard for MongoDB Atlas will appear in Dashboard Builder after successful integration. This default dashboard serves as a jumping off point for visualizing and analyzing MongoDB Atlas data.

MongoDB Atlas Default Dashboard

Create MongoDB Atlas Widget

You can add MongoDB Atlas data to dashboards as a custom widget. Follow these steps to configure your widget:

  1. Select Widget Dashboard Navigate to the Create Widget screen.
Create Widget Profile Screen
  1. Configure Widget Profile On the Widget Profile screen, select category as database and define the widget name and description.

  2. Set Up Configuration In the Widget Configuration screen, customize data settings, apply filters, and finalize widget preferences.

Create Widget Profile Screen
Create Widget Profile Screen

Alerts

Alerts can be configured for any MongoDB Atlas metrics. When creating a new rule, select the Database detection method and MongoDB Atlas database type for available metrics to appear in the Metrics dropdown list. Select the desired metric and continue configuring the alert conditions.

Metrics Collected

MetricDescription
mongodbatlas.process.assertsNumber of assertions per second
mongodbatlas.process.background_flushAmount of data flushed in the background
mongodbatlas.process.cache.ioCache throughput (per second)
mongodbatlas.process.cache.ratioCache ratios represented as (%)
mongodbatlas.process.cache.sizeCache sizes
mongodbatlas.process.connectionsNumber of current connections
mongodbatlas.process.cpu.usage.maxCPU Usage (%)
mongodbatlas.process.cpu.usage.averageCPU Usage (%)
mongodbatlas.process.cpu.children.usage.maxCPU Usage for child processes (%)
mongodbatlas.process.cpu.children.usage.averageCPU Usage for child processes (%)
mongodbatlas.process.cpu.children.normalized.usage.maxCPU Usage for child processes, normalized to pct
mongodbatlas.process.cpu.children.normalized.usage.averageCPU Usage for child processes, normalized to pct
mongodbatlas.process.cpu.normalized.usage.maxCPU Usage, normalized to pct
mongodbatlas.process.cpu.normalized.usage.averageCPU Usage, normalized to pct
mongodbatlas.process.cursorsNumber of cursors
mongodbatlas.process.db.storageStorage used by the database
mongodbatlas.process.db.document.rateDocument access rates
mongodbatlas.process.global_lockNumber and status of locks
mongodbatlas.process.index.btree_miss_ratioIndex miss ratio (%)
mongodbatlas.process.index.countersIndexes
mongodbatlas.process.journaling.commitsJournaling commits
mongodbatlas.process.journaling.data_filesData file sizes
mongodbatlas.process.journaling.writtenJournals written
mongodbatlas.process.memory.usageMemory Usage
mongodbatlas.process.network.ioNetwork IO
mongodbatlas.process.network.requestsNetwork requests
mongodbatlas.process.oplog.timeExecution time by operation
mongodbatlas.process.oplog.rateExecution rate by operation
mongodbatlas.process.db.operations.rateDB Operation Rates
mongodbatlas.process.db.operations.timeDB Operation Times
mongodbatlas.process.page_faultsPage faults
mongodbatlas.process.db.query_executor.scannedScanned objects
mongodbatlas.process.db.query_targeting.scanned_per_returnedScanned objects per returned
mongodbatlas.process.restartsRestarts in last hour
mongodbatlas.system.paging.usage.maxSwap usage
mongodbatlas.system.paging.usage.averageSwap usage
mongodbatlas.system.paging.io.maxSwap IO
mongodbatlas.system.paging.io.averageSwap IO
mongodbatlas.system.cpu.usage.maxSystem CPU Usage (%)
mongodbatlas.system.cpu.usage.averageSystem CPU Usage (%)
mongodbatlas.system.memory.usage.maxSystem Memory Usage
mongodbatlas.system.memory.usage.averageSystem Memory Usage
mongodbatlas.system.network.io.maxSystem Network IO
mongodbatlas.system.network.io.averageSystem Network IO
mongodbatlas.system.cpu.normalized.usage.maxSystem CPU Normalized to pct
mongodbatlas.system.cpu.normalized.usage.averageSystem CPU Normalized to pct
mongodbatlas.process.ticketsTickets
mongodbatlas.disk.partition.iops.maxDisk partition iops
mongodbatlas.disk.partition.iops.averageDisk partition iops
mongodbatlas.disk.partition.throughputDisk throughput
mongodbatlas.disk.partition.usage.maxDisk partition usage (%)
mongodbatlas.disk.partition.usage.averageDisk partition usage (%)
mongodbatlas.disk.partition.utilization.maxThe maximum percentage of time during which requests are being issued to and serviced by the partition.
mongodbatlas.disk.partition.utilization.averageThe percentage of time during which requests are being issued to and serviced by the partition.
mongodbatlas.disk.partition.latency.maxDisk partition latency
mongodbatlas.disk.partition.latency.averageDisk partition latency
mongodbatlas.disk.partition.space.maxDisk partition space
mongodbatlas.disk.partition.space.averageDisk partition space
mongodbatlas.disk.partition.queue.depthDisk queue depth
mongodbatlas.db.sizeDatabase feature size
mongodbatlas.db.countsDatabase feature size
mongodbatlas.system.fts.memory.usageFull-text search
mongodbatlas.system.fts.disk.usedFull text search disk usage
mongodbatlas.system.fts.cpu.usageFull-text search (%)
mongodbatlas.system.fts.cpu.normalized.usageFull text search disk usage (%)

Troubleshooting

Missing Integration Option

If you do not see the Integrations Menu in Middlware, that means your account has not been granted Installation permissions. Contact your system administrator to add the Installation permission to your user role in Settings.

Next Steps

Need assistance or want to learn more about Middleware? Contact our support team at [email protected].