I receive a "Rate exceeded" error message when I try to create, update, or access an AWS service. I want to use Amazon CloudWatch metrics to monitor the number of AWS API calls that I make so that I don't exceed the rate.
Short description
CloudWatch usage metrics track the number of API calls you make to AWS services. If you use API calls in automation, monitor your usage with CloudWatch usage metrics to avoid "Rate exceeded" errors.
Resolution
Note: The following steps use the PutMetricData API call as an example. Replace PutMetricData with the name of the API call you want to monitor.
To monitor your API call usage for all AWS resources that publish usage metrics, complete the following steps:
-
Check the default CloudWatch service quota for the API call that you want to monitor. To check your quotas, open the Service Quotas console. For example, the PutMetricData API has a default quota of 500 transactions per second (TPS).
-
Open the CloudWatch console.
-
In the navigation pane, choose Metrics, and then choose All metrics.
-
Choose the AWS/Usage namespace, and then choose PutMetricData.
-
Choose the CallCount metric to view the number of times the API call was made.
-
Choose Graphed metrics, and then choose the time range for when you received the "Rate exceeded" error.
-
To view the number of API calls that were made every minute, for Period, choose 1 minute. For Statistic, choose SUM.
-
To compare your usage against the service quota, choose Add math, and then choose Start with empty expression.
-
In the new row, enter the following expression:
SERVICE_QUOTA(m1)
This expression adds a horizontal line to the graph that represents your service quota. If the CallCount line approaches or exceeds the SERVICE_QUOTA line, then your API calls are at risk of throttling.
Related information
How do I find the AWS API call that's causing a "Rate exceeded" error?
Visualizing your service quotas and setting alarms