Client-Side Errors in Amazon API Gateway Metrics | AWS Certified SysOps Administrator Exam Preparation

Amazon API Gateway Metric for Counting Client-Side Errors

Question

An HTTP API is created using API Gateway.

During testing of the application, it was observed that some users are getting errors while accessing this application.

The Operations Team is looking for the count of client-side errors. Which API Gateway metric can be checked in Amazon CloudWatch to get these details?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

Amazon API Gateway sends metric data every minute to Amazon CloudWatch.

Following are the metrics.

4XXError.

5XXError.

CacheHitCount.

CacheMissCount.

Count.

IntegrationLatency.

Latency.

Metric 4XXError captures client-side errors which give a count of errors occurring during a specific period.

Options A and B are incorrect as these are invalid metrics for API Gateway.

Option D is incorrect as this will capture server-side errors.

For more information on monitoring Amazon API Gateway using AWS CloudWatch, refer to the following URL,

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html

The Operations team can check the Amazon CloudWatch API Gateway metrics to get the count of client-side errors for the HTTP API created using API Gateway.

API Gateway is a fully managed service provided by AWS to create, publish, maintain, monitor, and secure APIs at any scale. Amazon CloudWatch is a monitoring and observability service provided by AWS to collect and track metrics, collect and monitor log files, and set alarms.

When the API Gateway is used to create an HTTP API, it generates various CloudWatch metrics that can be used to monitor the API's performance, including the count of client-side errors. The possible API Gateway metrics that can be checked in Amazon CloudWatch to get the details of client-side errors are:

  • 2XXError: This metric represents the number of HTTP 2XX status codes returned by the API Gateway, indicating successful completion of the request. In the context of client-side errors, it represents the number of requests that resulted in successful completion.
  • 3XXError: This metric represents the number of HTTP 3XX status codes returned by the API Gateway, indicating redirection of the request to a different URL or endpoint. In the context of client-side errors, it does not represent any error.
  • 4XXError: This metric represents the number of HTTP 4XX status codes returned by the API Gateway, indicating client-side errors such as bad request, unauthorized access, or forbidden access. In the context of client-side errors, it represents the number of requests that failed due to client-side errors.
  • 5XXError: This metric represents the number of HTTP 5XX status codes returned by the API Gateway, indicating server-side errors such as internal server error or gateway timeout. In the context of client-side errors, it does not represent any error.

Therefore, the correct answer to the given question is option C, i.e., 4XXError. This metric represents the count of client-side errors in the form of HTTP 4XX status codes returned by the API Gateway, indicating requests that failed due to client-side errors.