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.
  • Middleware Host Agent (MW Agent - version 1.15.0 or above) installed on your local machine. To install the MW Agent, refer to our Installation Guide.

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, provide your MongoDB Atlas API credentials.

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 colleted. 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.

Create MongoDB Atlas API Key

  • Step 1: Log in to MongoDB Atlas.

Go to Settings > Projects > {Your-Project} > Access Manager > Applications > API Keys.

  • Step 2: Generate API Key.

Click Create Application > API Key.

- Add description and grant permissions.

- Copy Public Key and Private Key and store them securely. (as you won't be able to access it later on from MongoDB Atlas)

- Add your IP address in API access list entry.

- Add your IP address in IP access list under network access tab of the project.

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 what clusters to include or what clusters to exclude. (Not both at once)
  • Retry On Failure (Optional):
    • Enabled : true / false (default : true)
    • Initial interval : Time to wait before the first retry attempt. (default : 5s)
    • Max interval : Maximum wait time between retry attempts. (default : 30s)
    • Max elapsed time : Total time allowed for all retry attemps. (default : 5m)
  • Alerts (Optional):
    • Enabled : true / false (default : false)
    • Mode : listen / poll (default : listen)
    • Endpoint : Webhook endpoint to receive alerts in listen mode.
    • Secret : Authentication token required for listen mode.
    • Poll Interval : Frequency of polling for alerts in poll mode. (default : 5m)
    • Page Size : Number of alerts fetched per API request in poll mode. (default : 100)
    • Max Pages : Maximum pages of alerts fetched per project in poll mode. (default: 10)
    • Projects :
      • 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)
    • TLS :
      • Key File : Path to TLS private key file used in listen mode.
      • Cert File : Path to TLS certificate file used in listen mode.
  • Logs (Optional):
    • Enabled : true / false (default : false)
    • Projects : required if enabled
      • 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)
      • Collect host logs : true / false (default : true)
      • Collect audit logs : true / false (default : false)
      • Access logs :
        • Enabled : true / false (default : true)
        • Auth Result : (true / false) If specified, will limit the access logs queried to successful accesses (true) or failed accesses (false). If not specified, all will be collected.
        • Page Size : This is the number of access logs that will be processed per request to the MongoDB Atlas API. The maximum value is 20000. (default : 20000)
        • Max Pages : This will limit how many pages of access logs the receiver will request from the MongoDB Atlas API for a project. (default : 10)
        • Poll Interval : This will define how frequently the MongoDB Atlas API is queried for Access Logs for the given project. (default : 5m)
  • Events (Optional):
    • Projects :
      • Name : Name of the project to discover events from.
    • Organizations :
      • ID : ID of the organization to discover events from.
    • Poll Interval : Frequency of polling the Events API for new events. (default : 1m)
    • Page Size : Number of events processed per request. (default : 100)
    • Max Pages : Limit number of pages the receiver will request. (default : 25)
    • Types : Receiver will collect only indicated type of events if specified.
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].