Logging and monitoring in Amazon API Gateway - Amazon API Gateway
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).

Logging and monitoring in Amazon API Gateway

Monitoring is an important part of maintaining the reliability, availability, and performance of API Gateway and your Amazon solutions. You should collect monitoring data from all of the parts of your Amazon solution so that you can more easily debug a multi-point failure if one occurs. Amazon provides several tools for monitoring your API Gateway resources and responding to potential incidents:

Amazon CloudWatch Logs

To help debug issues related to request execution or client access to your API, you can enable CloudWatch Logs to log API calls. For more information, see Setting up CloudWatch logging for a REST API in API Gateway.

Amazon CloudWatch Alarms

Using CloudWatch alarms, you watch a single metric over a time period that you specify. If the metric exceeds a given threshold, a notification is sent to an Amazon Simple Notification Service topic or Amazon Auto Scaling policy. CloudWatch alarms do not invoke actions when a metric is in a particular state. Rather the state must have changed and been maintained for a specified number of periods. For more information, see Monitoring REST API execution with Amazon CloudWatch metrics.

Access Logging to Firehose

To help debug issues related to client access to your API, you can enable Firehose to log API calls. For more information, see Logging API calls to Amazon Data Firehose.

Amazon CloudTrail

CloudTrail provides a record of actions taken by a user, role, or an Amazon service in API Gateway. Using the information collected by CloudTrail, you can determine the request that was made to API Gateway, the IP address from which the request was made, who made the request, when it was made, and additional details. For more information, see Logging Amazon API Gateway API calls using Amazon CloudTrail.

Amazon X-Ray

X-Ray is an Amazon service that gathers data about the requests that your application serves, and uses it to construct a service map that you can use to identify issues with your application and opportunities for optimization. For more information, see Setting up Amazon X-Ray with API Gateway REST APIs.

Amazon Config

Amazon Config provides a detailed view of the configuration of Amazon resources in your account. You can see how resources are related, get a history of configuration changes, and see how relationships and configurations change over time. You can use Amazon Config to define rules that evaluate resource configurations for data compliance. Amazon Config rules represent the ideal configuration settings for your API Gateway resources. If a resource violates a rule and is flagged as noncompliant, Amazon Config can alert you using an Amazon Simple Notification Service (Amazon SNS) topic. For details, see Monitoring API Gateway API configuration with Amazon Config.