Monitoring metrics in DynamoDB with Amazon CloudWatch
You can monitor DynamoDB using CloudWatch, which collects and processes raw data from DynamoDB into readable, near real-time metrics. These statistics are retained for a period of time, so you can access historical information for a better perspective on how your web application or service is performing. By default, DynamoDB metric data is sent to CloudWatch automatically. For more information, see What is Amazon CloudWatch? and Metrics retention in the Amazon CloudWatch User Guide.
Topics
How do I use DynamoDB metrics?
The metrics reported by DynamoDB provide information that you can analyze in different ways. The following list shows some common uses for the metrics. These are suggestions to get you started, not a comprehensive list.
How can I? |
Relevant metrics |
---|---|
How can I monitor the rate of TTL deletions on my table? |
You can monitor |
How can I determine how much of my provisioned throughput is being used? |
You can monitor |
How can I determine which requests exceed the provisioned throughput quotas of a table? |
|
How can I determine if any system errors occurred? |
You can monitor |
How can I monitor the latency value for my table operations? |
You can monitor |
Viewing metrics in the CloudWatch console
Metrics are grouped by the service namespace first and then by the various dimension combinations within each namespace.
To view metrics in the CloudWatch console
Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/
. -
In the navigation pane, choose Metrics, All metrics.
-
Select the DynamoDB namespace. You can also select Usage namespace to view DynamoDB usage metrics. For more information about usage metrics, see AWS usage metrics.
-
The Browse tab displays all metrics in the namespace.
-
(Optional) To add the metric graph to a CloudWatch dashboard, choose Actions, Add to dashboard.
Viewing metrics in the AWS CLI
To obtain metric information using the AWS CLI, use the CloudWatch command list-metrics
.
In the following example, you list all metrics in the AWS/DynamoDB
namespace.
aws cloudwatch list-metrics --namespace "AWS/DynamoDB"
To obtain metric statistics, use the command get-metric-statistics
. The
following command gets ConsumedReadCapacityUnits
statistics for the table
ProductCatalog
over the specific 24-hour period, with a 5-minute
granularity.
aws cloudwatch get-metric-statistics —namespace AWS/DynamoDB \ —metric-name ConsumedReadCapacityUnits \ —start-time 2023-11-01T00:00:00Z \ —end-time 2023-11-02T00:00:00Z \ —period 360 \ —statistics Average \ —dimensions Name=TableName,Value=ProductCatalog
Sample output appears as follows:
{ "Datapoints": [ { "Timestamp": "2023-11-01T 09:18:00+00:00", "Average": 20, "Unit": "Count" }, { "Timestamp": "2023-11-01T 04:36:00+00:00", "Average": 22.5, "Unit": "Count" }, { "Timestamp": "2023-11-01T 15:12:00+00:00", "Average": 20, "Unit": "Count" }, ... { "Timestamp": "2023-11-01T 17:30:00+00:00", "Average": 25, "Unit": "Count" } ], "Label": " ConsumedReadCapacityUnits " }