Monitoring and Alerts

Overview

mLab’s monitoring features are designed to ensure you always have insight into the health of your deployment.

mLab Telemetry

Not available for Sandbox databases

mLab’s Telemetry service is a real-time and historical monitoring tool for mLab deployments that tracks key MongoDB metrics and helps you effectively monitor and tune database performance. It provides a customizable dashboard that gives you the ability to easily view and compare database and OS performance over time. You can also define custom alerts with Telemetry.

img-telemetry

How to access Telemetry

Not available for Sandbox databases

  1. Log in to the mLab management portal
  2. From your account’s Home page, there are two different ways to open Telemetry:
    • Option 1: Locate the row of the deployment whose stats you want to view and click the graph icon that appears at the end of the row
    • Option 2: Click the row of the deployment whose stats you want to view
      • Once the home page of the deployment opens, click the “Monitoring” tab to see the first set of critical metrics
      • Click the row of the server whose statistics you want to see
  3. After Telemetry opens in its own window, you will see the historical graphs
    • From here, you can switch which server you are viewing, re-arrange the dashboard layout, and/or use the controls in the menu bar to choose your desired view
  4. (Optional) To view real-time statistics, click the “LIVE STATS” button located in the “ZOOM” section of the menu bar above the graphs
    • From within the new window that opens, you can also switch to any of the other servers in your deployment

Real-time and historical statistics

Historical graphs in Telemetry

There are currently historical graphs for all of the MongoDB metrics below and more:

Additional graphs primarily applicable to the MMAPv1 storage engine:

Additional graphs primarily applicable to the WiredTiger storage engine:

Real-time stats in Telemetry

If you clicked the “LIVE STATS” button after opening the Telemetry dashboard, you can view key performance metrics for your database deployment in real-time. These metrics are streamed from MongoDB’s mongostat utility.

When you open the live stats view, you will see the output of mongostat streaming in a tabular form. For an explanation of these metrics, read the mongostat documentation.

In addition to these real-time performance statistics, you can use the mLab management portal to view current database and collection storage statistics (e.g., data size).

Custom alerts

mLab’s Telemetry service also allows you to define custom alerts on database metrics. When alert thresholds are breached, notifications will be sent to associated notification channels such as email or services like PagerDuty, HipChat, and Slack. For details, visit our documentation on Telemetry Alerts.

Further reading

mLab’s blog is a place where we provide additional insight and assistance with Telemetry-related metrics and features. Our posts are designed to help you make the most out of the valuable data in Telemetry with articles such as:

mLab Slow Query Analyzer

Not available for Sandbox databases

The Slow Queries feature in the mLab management portal provides an analysis of the slow operations that have recently run on your database deployment. We run this analysis several times a day so that you can have up-to-date information.

  1. Log in to the mLab management portal
  2. From your account’s Home page, navigate to the deployment you want to analyze
  3. Click the “Slow Queries” tab

For each query found in your logs (by default those taking over 100ms), we provide statistics about that query, and let you know if the query is properly indexed. Results are sorted by the total time consumed by all occurrences of a query, so that the most expensive queries are at the top.

If you have not already added what the slow query analyzer considers an ideal index, click “Build this index” button next to the recommendation to create that index.

Note: An optimally indexed query with a high average time is potentially a symptom of other unindexed queries.

This analysis is not a substitute for having a direct understanding of your data model and the queries your application uses. Also, be careful to avoid creating too many indexes or redundant indexes. If you have any questions, don’t hesitate to email support@mlab.com at any time.

MongoDB log files and database profiler

Access to MongoDB log files

mLab has made it convenient to access database server log files through the mLab management portal and watch in real-time as operations are written to the log. You can also download archived log files instead of streaming them, if you choose.

While MongoDB stores its times in UTC, mLab’s database log files are logging in UTC-08 (or UTC-07 during Pacific Daylight Time), based on the timezone setting of the underlying hosts for your deployment.

Current log file streaming

Not available for Sandbox databases

To watch in real-time as operations are written to the log, follow these instructions:

  1. Log in to the mLab management portal
  2. From your account’s Home page, navigate to the deployment with the desired logs
  3. Click the “Logs” tab and the mongodb.log files for your current primary will be listed img-logs
  4. To see the log files for a secondary or arbiter server, use the “Select server” drop-down menu to select the desired server
  5. Click the “Stream current log” button to watch the current log file in real-time

Downloading archived log files

Not available for Sandbox databases

In addition to the ability to stream the current MongoDB log file, you can also download archived log files by following these instructions:

  1. Log in to the mLab management portal
  2. From your account’s Home page, navigate to the deployment with the desired logs
  3. Click the “Logs” tab and the log files for your current primary will be listed img-logs
  4. To see the log files for a secondary or arbiter server, use the “Select server” drop-down menu to select the desired server
  5. Click the desired filename to download the file (or use a download method appropriate for your browser, such as right-clicking and selecting save).
    • Log files are identifiable by timestamps that indicate the last time (in UTC) the file was written to before being rotated to the next file

Access to MongoDB’s database profiler

Through the mLab management portal you can easily enable and examine the database profiler.

Because profiling incurs additional overhead on your database, we recommend you understand the profiler’s overhead before making use of this MongoDB feature.

Enabling the profiler

  1. Log in to the mLab management portal
  2. From your account’s Home page, navigate to the deployment with the database that you want to profile
    • If necessary, navigate to the desired database after navigating to the deployment
  3. Click the “Tools” tab
  4. Click the “Commands” link to display the “Run command” drop-down menu
  5. In the drop-down menu, select “profile (log slow)” or “profile (log all)”
    img-profiler
  6. Click “Run command” to enable profiling
  7. Click the “Collections” tab and then refresh the browser page
  8. Navigate to the system.profile collection to analyze the results of the profiler

If you choose “profile (log slow)”, MongoDB logs operations that take longer than the SLOW_MS value set for your database (the default is 100ms). You can check the current SLOW_MS value by selecting the “profile (get current status)” command in the mLab management portal, or by running db.getProfilingLevel() in the mongo shell.

Disabling the profiler and deleting the results

To turn off the database profiler and delete the data in the system.profile collection:

  1. Click the “Tools” tab
  2. Click the “Commands” link to display the “Commands” drop-down menu
  3. To disable the profiler, select “profile (turn off)” in the drop-down menu
  4. (Optional) To clear the contents of the profiler, connect to your database using the mongo shell and run db.system.profile.drop()

Critical availability notifications

Notifications about incidents which have impacted or may impact the availability of your deployment will always be sent to the appropriate Account Contacts listed for your mLab account or posted on our status page, mLab Status.

Types of critical availability notifications

Downtime

If your database is experiencing or has experienced downtime, you can expect to receive updates about this downtime on mLab Status or via an email notification to the Technical Contact listed on your account.

Note that we do not post incidents on our public status page about free Sandbox databases that have been or will be down for a short period of time since these are single-node plans without redundancy.

Low disk space

mLab sends multiple warning emails when you approach and/or exceed the storage limit allowed for your plan.

Do not ignore these warnings because running out of disk space will lead to downtime. We strongly recommend that you immediately take one or more of the following steps after receiving a notification:

Rollbacks during failover

A rollback reverts changes on a former primary as it comes back as a secondary after failover in order to maintain database consistency with the other member(s).

If the node is able to successfully write the rollback data to files, we will load these files into your database(s) within the same deployment as new collection(s) and then notify you via email.

If the node is unable to rollback, it will enter the FATAL state, and we will notify you immediately and work with you to manually recover the data.

mLab Status

We monitor all of our services 24x7 and keep our status page at status.mlab.com up-to-date.

Our status page provides historical, current, and upcoming availability updates for our Sandbox and Shared plan databases. This page also provides availability updates for other services such as mLab’s management portal, mLab Telemetry, mLab Backup System, mLab Slow Query Analyzer, and Partner API. It also provides updates on widespread outages.

Generally if a notifiation is sent via email directly to an account, it will not also appear on mLab Status. If you have a question about your deployment and don’t see anything relevant on our status page, you may have been alerted directly through email. Otherwise, contact support@mlab.com for more information.

If you have a Dedicated Cluster plan deployment which is facing a critical, production issue that requires immediate attention, you may also use the emergency email address we have provided.

img-status

Third-party integrations

Integration with New Relic

Not available for Sandbox databases

If you use New Relic for application performance management (APM), you can integrate your mLab-hosted deployment(s) to quickly view your MongoDB database performance metrics.

img-newrelic
Our plugin provides users with important MongoDB serverStatus data. Specifically, you can view the following database metrics:

  1. Operations
  2. Queues
  3. Lock %
  4. Page Faults
  5. Non-mapped Virtual Memory
  6. Memory
  7. Replication Operations
  8. Replication Lag
  9. Oplog Window

The plugin also comes with default alert thresholds set on the database lock % metric. If there are any other metrics you’d like to see, let us know at support@mlab.com.

Setting up the integration

For teams that already use New Relic, simply add your New Relic APM license key to your mLab account by following these steps:

  1. Obtain your New Relic license key
    img-newrelickey
  2. Log in to the mLab management portal
  3. Click “Account” in the upper right-hand corner to open the Account Settings page
  4. Click the “Monitoring” tab
  5. Enter your key in the “License key” field in the “New Relic” section img-enternrkey
  6. Click “Save key”