Amazon CloudWatch metrics for Performance Insights - Amazon DocumentDB
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon CloudWatch metrics for Performance Insights

Performance Insights automatically publishes metrics to Amazon CloudWatch. The same data can be queried from Performance Insights, but having the metrics in CloudWatch makes it easy to add CloudWatch alarms. It also makes it easy to add the metrics to existing CloudWatch Dashboards.

Metric Description

DBLoad

The number of active sessions for Amazon DocumentDB. Typically, you want the data for the average number of active sessions. In Performance Insights, this data is queried as db.load.avg.

DBLoadCPU

The number of active sessions where the wait state type is CPU. In Performance Insights, this data is queried as db.load.avg, filtered by the wait state type CPU.

DBLoadNonCPU

The number of active sessions where the wait state type is not CPU.

Note

These metrics are published to CloudWatch only if there is load on the DB instance.

You can examine these metrics using the CloudWatch console, the Amazon CLI, or the CloudWatch API.

For example, you can get the statistics for the DBLoad metric by running the get-metric-statistics command.

aws cloudwatch get-metric-statistics \ --region ap-south-1 \ --namespace AWS/DocDB \ --metric-name DBLoad \ --period 360 \ --statistics Average \ --start-time 2022-03-14T8:00:00Z \ --end-time 2022-03-14T9:00:00Z \ --dimensions Name=DBInstanceIdentifier,Value=documentdbinstance

This example generates output similar to the following.

{ "Datapoints": [ { "Timestamp": "2022-03-14T08:42:00Z", "Average": 1.0, "Unit": "None" }, { "Timestamp": "2022-03-14T08:24:00Z", "Average": 2.0, "Unit": "None" }, { "Timestamp": "2022-03-14T08:54:00Z", "Average": 6.0, "Unit": "None" }, { "Timestamp": "2022-03-14T08:36:00Z", "Average": 5.7, "Unit": "None" }, { "Timestamp": "2022-03-14T08:06:00Z", "Average": 4.0, "Unit": "None" }, { "Timestamp": "2022-03-14T08:00:00Z", "Average": 5.2, "Unit": "None" } ], "Label": "DBLoad" }

You can use the DB_PERF_INSIGHTS metric math function in the CloudWatch console to query Amazon DocumentDB Performance Insights counter metrics. The DB_PERF_INSIGHTS function also includes the DBLoad metric at sub-minute intervals. You can set CloudWatch alarms on these metrics. For more details on how to create an alarm, see Create an alarm on Performance Insights counter metrics from an Amazon Web Services database.

For more information about CloudWatch, see What is Amazon CloudWatch? in the Amazon CloudWatch User Guide.