Monitoring and Troubleshooting in API Gateway
For API execution, API Gateway automatically reports to Amazon CloudWatch your API's execution metrics on the API- and stage-levels. The metrics include statistics about caching, latency and detected errors. You can also opt in for API Gateway to send to CloudWatch method-level metrics, using the API Gateway console or calling the API Gateway REST API or one of its SDKs. Based on these metrics, you can set CloudWatch custom alarms for troubleshooting any performance issues of your APIs. For more information about CloudWatch, see the Amazon CloudWatch User Guide.
For API management using API Gateway REST API, you can create AWS CloudTrail trails to log events involved in the API Gateway REST API calls. You can use the logs to troubleshoot API creation, deployment and updates. You can also use Amazon CloudWatch to monitor the CloudTrail logs. To learn more about CloudTrail, see the AWS CloudTrail User Guide.
CloudTrail logs API Gateway REST API calls an API developer or owner made against the
apigateway component, whereas CloudWatch logs API calls an API customer or client made against the
execute-api component of API Gateway.