Skip to main content
Sumo Logic

Install the MongoDB Monitors, App, and View the Dashboards

This page has instructions for installing Sumo Logic Monitors for MongoDB, the app, and descriptions of each of the app dashboards. These instructions assume you have already set up collection as described in the Collect Logs and Metrics for MongoDB App page.

Install Monitors

Sumo Logic has provided pre-packaged alerts available through Sumo Logic monitors to help you proactively determine if a MongoDB cluster is available and performing as expected. These monitors are based on metric and log data and include pre-set thresholds that reflect industry best practices and recommendations. For more information about individual alerts, see MongoDB Alerts.

To install these monitors, you must have the Manage Monitors role capability.

You can install monitors by importing a JSON file or using a Terraform script.

Method 1: Install Monitors by importing a JSON file

  1. Download the JSON file that describes the monitors. 
  2. Replace $$mongodb_data_source with a custom source filter. To configure alerts for a specific database cluster, use a filter like db_system=mongodb or db_cluster=dev-mongodb. To configure the alerts for all of your clusters, set $$mongodb_data_source to blank ("").
  3. Go to Manage Data > Alerts > Monitors.
  4. Click Add.
  5. Click Import.
  6. On the Import Content popup, enter "MongoDB" in the Name field, paste in the JSON into the the popup, and click Import
  7. The monitors are created in a "MongoDB" folder. The monitors are disabled by default. See the Monitors topic for information about enabling monitors and configuring notifications or connections.

Method 2: Install Monitors using a Terraform script

Step 1: Generate a Sumo Logic access key and ID

Generate an access key and access ID for a user that has the Manage Monitors role capability. For instructions see  Access Keys

Step 2: Download and install Terraform

Download Terraform 0.13 or later, and install it. 

Step 3: Download the Sumo Logic Terraform package for MongoDB monitors

The alerts package is available in the Sumo Logic github repository. You can either download it using the git clone command or as a zip file. 

Step 4: Alert Configuration 

After extracting the package , navigate to the  terraform-sumologic-sumo-logic-monitor/monitor_packages/MongoDB/ directory.

Edit the file and add the Sumo Logic Access Key and Access ID from Step 1 and your Sumo Logic deployment. If you're not sure of your deployment, see Sumo Logic Endpoints and Firewall Security

access_id   = "<SUMOLOGIC ACCESS ID>"
access_key  = "<SUMOLOGIC ACCESS KEY>"
environment = "<SUMOLOGIC DEPLOYMENT>"

The Terraform script installs the alerts without any scope filters, if you would like to restrict the alerts to specific clusters or environments, update the mongodb_data_source variable. For example:

To configure alerts for... Set mongodb_data_source to something like...
A specific cluster
All clusters in an environment environment=prod
Multiple clusters using a wildcard db_cluster=mongodb-prod*
A specific cluster within a specific environment db_cluster=mongodb-1 and environment=prod

This assumes you have configured and applied Fields as described in Step 1: Configure Fields of the Sumo Logic of the Collect Logs and Metrics for MongoDB topic.

All monitors are disabled by default on installation. To enable all of the monitors, set the monitors_disabled parameter to false.

By default, the monitors will be located in a "MongoDB" folder on the Monitors page. To change the name of the folder, update the monitor folder name in the folder variable in the file.

If you want the alerts to send email or connection notifications, follow the instructions in the next section.

Step 5: Email and Connection Notification Configuration Examples

Edit the file to populate the connection_notifications and email_notifications sections. Examples are provided below.

Pagerduty connection example

In the variable definition below, replace <CONNECTION_ID> with the connection ID of the Webhook connection. You can obtain the Webhook connection ID by calling the Monitors API.

connection_notifications = [
      connection_type       = "PagerDuty",
      connection_id         = "<CONNECTION_ID>",
      payload_override      = "{\"service_key\": \"your_pagerduty_api_integration_key\",\"event_type\": \"trigger\",\"description\": \"Alert: Triggered {{TriggerType}} for Monitor {{Name}}\",\"client\": \"Sumo Logic\",\"client_url\": \"{{QueryUrl}}\"}",
      run_for_trigger_types = ["Critical", "ResolvedCritical"]
      connection_type       = "Webhook",
      connection_id         = "<CONNECTION_ID>",
      payload_override      = "",
      run_for_trigger_types = ["Critical", "ResolvedCritical"]

Email notifications example

email_notifications = [
      connection_type       = "Email",
      recipients            = [""],
      subject               = "Monitor Alert: {{TriggerType}} on {{Name}}",
      time_zone             = "PST",
      message_body          = "Triggered {{TriggerType}} Alert on {{Name}}: {{QueryURL}}",
      run_for_trigger_types = ["Critical", "ResolvedCritical"]
Step 6: Install Monitors
  1. Navigate to the terraform-sumologic-sumo-logic-monitor/monitor_packages/MongoDB/ directory and run terraform init. This will initialize Terraform and download the required components.
  2. Run terraform plan to view the monitors that Terraform will create or modify.
  3. Run terraform apply.

Install the Sumo Logic App

Now that you have set up collection for MongoDB, install the Sumo Logic App for MongoDB to use the preconfigured searches and dashboards to analyze your data.

To install the app:

Locate and install the app you need from the App Catalog. If you want to see a preview of the dashboards included with the app before installing, click Preview Dashboards.

  1. From the App Catalog, search for and select the app. 
  2. Select the version of the service you're using and click Add to Library.
  1. To install the app, complete the following fields.
    1. App Name. You can retain the existing name, or enter a name of your choice for the app.

    2. Data Source. Select either of these options for the data source.

      • Choose Source Category, and select a source category from the list.

      • Choose Enter a Custom Data Filter, and enter a custom source category beginning with an underscore. Example: (_sourceCategory=MyCategory).

    3. Advanced. Select the Location in Library (the default is the Personal folder in the library), or click New Folder to add a new folder.
  2. Click Add to Library.

Once an app is installed, it will appear in your Personal folder, or other folder that you specified. From here, you can share it with your organization. 

Panels will start to fill automatically. It's important to note that each panel slowly fills with data matching the time range query and received since the panel was created. Results won't immediately be available, but with a bit of time, you'll see full graphs and maps. 


MongoDB - Overview

The MongoDB - Overview dashboard provides an at-a-glance view of MongoDB health, performance and problems causing errors.

Use this dashboard to:

  • Identify Slow Queries impacting the performance.
  • Gain insights into Replication and Sharding operations.
  • Verify Page Faults generated to determine the root cause of the problems.

MongoDB - Resource

The MongoDB - Resource dashboard shows resource utilization by the MongoDB component.

Use this dashboard to:

  • Determine Memory and Disk Usage.
  • Identify potential resource constraints and issues.

MongoDB - Errors and Warnings

The MongoDB - Errors and Warnings dashboard shows errors and warnings by the MongoDB component.

Use this dashboard to:

  • Determine components producing multiple errors or warnings.

MongoDB - Logins and Connections

The MongoDB - Logins and Connections dashboard shows geo location of client connection requests, failed connection logins by geo location, and count of failed login attempts.

Use this dashboard to:

  • Determine potential hacking attempts.
  • Determine location of attacks.

MongoDB - Queries

MongoDB queries include the following definitions:

  • MongoDB queries include the following database commands: find, insert, remove, delete or update.
  • Slow queries are defined as queries that take more than 100 milliseconds.
  • keysExamined are the number of index keys that MongoDB scanned in order to carry out the operation.

MongoDB - Replication

The MongoDB - Replication dashboard shows replication events, errors, warnings, and nodes.

Use this dashboard to:

  • Identify Replication errors and warnings.
  • Gain insights into Arbiter, Primary and Secondary node health.

MongoDB - Sharding

The MongoDB - Sharding dashboard dashboard shows sharding related errors, events, failures and number of chunks moving between shards.

Use this dashboard to:

  • Identify Sharding errors and warnings.
  • Gain insights into Chunk operations.