Amazon API Gateway Monitoring

Amazon API Gateway lets you create, configure and host RESTful APIs to help mobile apps and web application access AWS services. Using Site24x7's AWS integration you can monitor statistics on API calls, caching, latency, server-side and client errors not only on an API stage level but also on a method level.

Monitor API execution on stage level

Pre requisites

API Gateway automatically exposes metrics to CloudWatch on the API and stage-level. To monitor API calls, latency, integration latency, 400 and 500 errors for all methods associated with an resource you need to enable Detailed CloudWatch metrics.

To enable Detailed CloudWatch metrics:

  • Sign in to AWS management console. Go to the API Gateway console.
  • Choose the API. Click on Stages.
  • In the Stage list for the API, choose the stage.
  • Choose Logs in the Stage Editor.
  • To enable, choose Enable Detailed CloudWatch Metrics under CloudWatch Settings.
  • Choose Save Changes.

Setup and configuration

  • If you haven't done it already, please enable access to your AWS resources either by creating Site24x7 as an IAM user or by creating a cross-account IAM role between your AWS account and Site24x7's AWS account. Learn more.
  • Next, in the Integrate AWS Account page, please ensure the check box next to the API Gateway Stage listing is selected. Learn more.

Policies and permissions

Please make sure the following read-level action is present in the policy document assigned to the Site24x7 IAM entity. Learn more.

  • apigateway:GET

Polling frequency

By default, API Gateway metric data points are sent to CloudWatch every 1 minute. Site24x7 aggregates the data collected at every 1 minute into 5 minute averages. Learn more.

IT Automations

You can add automations for the AWS services supported by Site24x7. Log in to Site24x7 and go to Admin > IT Automation Templates (+) > Add Automation Templates. Once automations are added, you can schedule them to be executed one after the other.

You can now automatically invoke an api in the Amazon API Gateway using Amazon API Gateway automations.

Supported metrics

Site24x7 collects the following metrics on an API stage level.

MetricDescriptionData typeStatistic
4XX errors Measures the number of captured client-side errors Count Sum
5XX errors Measures the number of captured server-side errors. Count Sum
Cache hit count Measures the number of requests served from the API cache. Count Sum
Cache miss count Measures the number of requests served by the back-end when caching is enabled. Count Sum
Count Measures the total number of API requests Count Sum
Integration latency Measures the elapsed time between when an API Gateway routes a request to the back end and receives a response from the back end. Millisecond Average and 95th percentile
Latency Measures the elapsed time between when an API Gateway receives a request from the client and when it returns a response to the client. Millsecond Average and 95th percentile

To view data

  • Sign in to the Site24x7 console. Click on AWS. Choose the monitored AWS account.
  • Choose API Gateway Stage from the menu dropdown.
  • From the list of monitored API stages, choose the stage for which you want to see metrics for.
  • The various time series graphs (visual representation of your metrics) applicable for your resource can be seen in the API Gateway Summary tab.

Monitor API execution on method level

Monitor, visualize and alert on API execution metrics for all defined methods associated with a resource path to solve problems in API execution and implementation.

Pre requisites

  • The Amazon API Gateway integration should be enabled.
  • The API Gateway stage monitor in the Site24x7 console should be active.
  • Detailed CloudWatch metrics must be enabled for the API stage.

Add API Gateway Resource Monitor

This section describes how to discover and add API Gateway resources as monitors:

  • Sign in to the Site24x7 console. Click on AWS. Choose the monitored AWS account.
  • From the menu dropdown, choose API Gateway Resource.

Discover

This section describes how you can opt-in specific resources from you API stage.

  • Choose an API stage from the dropdown (multiple selections is not possible)
  • Next, type a proper Regex to match resources in the chosen API stage. Append .* as a prefix or suffix to the input string to opt-in specific resources from the API stage.
    For example, imagine that the API stage exposes multiple resources Viz. /income, /user, /expense. You can type in .*/income to only include resources belonging to that particular path.
  • Click on Discover Resources.

Add

All the resources matching your Regex pattern, along with their methods would get listed below.

  • Click on the check box next to the resource path for the resource you wish to monitor
  • Click on Add selected Resources to them as monitors.

To view data

  • Sign in to the Site24x7 console.
  • Click on AWS. Choose the monitored AWS account.
  • Choose API Gateway Resource from the menu dropdown.
  • From the list of monitored resources, choose the resource for which you want to see metrics for.

Metadata

API Overview

The API Overview tab provides information about the service's state and configuration.

Stage properties

AtrributeDescription
API Gateway id Displays the API identifier.
API Gateway name Shows the API Gateway name.
Region Shows the region where the API gateway resides.

 

AtrributeDescription
Stage name Displays the name of the stage (The first path segment in the URI of a call to API gateway)
Created date Displays the timestamp when the stage was created.
Last updated time Displays the timestamp when the stage last updated.
Deployment id Displays the Deployment identifier that the stage points to.
Description Shows the stage's description.
Cache cluster Shows whether a cache cluster is enabled for this stage.
Cache cluster size The size of the cache cluster, if enabled.
Cache cluster status The status of the cache cluster, if enabled.
Document version Shows the version of the associated API documentation.
Access logs Displays the setting for logging access.
Client certificate id Displays the client certificate identifier for the API stage.
stage variables Displays the stage variables.

Method settings

AttributeDescription
Metrics monitoring Specifies whether Amazon CloudWatch metrics are enabled or not.
Logging level Specifies the logging level for the method (OFF,ERROR or INFO.
Data trace Specifies whether trace logging is enabled for this method.
Throttling burst limit Specifies the throttling burst limit.
Throttling rate limit Specifies the throttling rate limit.
Destination ARN Displays the ARN of the CloudWatch logs group that receives access logs.
API cache Shows whether responses should be cached and returned for requests or not.
Cache time to live Displays the time to live (TTL) in seconds, for cached responses.
Cache data encryption Shows whether the cache response is encrypted or not.
Require authorization Shows whether authorization is required for cache invalidation request. 
Handle authorization requests Displays how to handle unauthorized requests for cache invalidation.

Canary settings

AttributeDescription
Canary deployment ID Shows the identifier of the canary deployment the stage points to.
Percent traffic Displays the percent of traffic diverted to a canary deployment.
Canary stage variables Shows the stage variables overidden for canary release deployment.
Use of stage cache Indicates whether canary deployement stage uses the stage cache or not. 

Resource settings

AttributeDescription
Resource ID Displays the resource identifier.
Parent ID Displays the percent of traffic diverted to a canary deployment.
Resource path Shows the full path for the resource.
Methods Shows the method's HTTP verb.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.