Skip to content

AWS API Gateway

The displayed Metrics for AWS API Gateway include request response time, throughput, concurrent connections, and error rate, which reflect the performance and reliability of API Gateway in handling API requests and traffic management.

Configuration

Install Func

It is recommended to activate the TrueWatch integration - extensions - hosted Func: all prerequisites are automatically installed, please proceed with the script installation.

If you are deploying Func manually, refer to Manual Func Deployment

Install Script

Note: Please prepare the required Amazon AK in advance (for simplicity, you can directly grant global read-only permissions ReadOnlyAccess)

Hosted Version Activation Script

  1. Log in to the TrueWatch console
  2. Click the 【Integration】 menu and select 【Cloud Account Management】
  3. Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have previously configured cloud account information, you can skip this step.
  4. Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and retest.
  5. Click on the cloud account in the 【Cloud Account Management】 list to see the added cloud account, and click on the corresponding cloud account to enter the details page.
  6. Click the 【Integration】 button on the cloud account details page, find AWS API Gateway under the Not Installed list, and click the 【Install】 button to pop up the installation interface for installation.

Manual Activation Script

  1. Log in to the Func console, click 【Script Market】, enter the TrueWatch script market, and search for integration_aws_gateway

  2. Click 【Install】, then enter the corresponding parameters: AWS AK ID, AK Secret, and account name.

  3. Click 【Deploy Startup Script】, the system will automatically create the Startup script set and automatically configure the corresponding startup script.

  4. After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute once without waiting for the scheduled time. After a while, you can check the execution task records and corresponding logs.

Verification

  1. In 「Management / Automatic Trigger Configuration」, confirm whether the corresponding task has the corresponding automatic trigger configuration, and you can also check the corresponding task records and logs to see if there are any anomalies.
  2. In TrueWatch, check if there is asset information in 「Infrastructure / Custom」.
  3. In TrueWatch, check if there is corresponding monitoring data in 「Metrics」.

Metrics

After configuring Amazon CloudWatch, the default Measurement is as follows. You can collect more Metrics through configuration. Amazon CloudWatch Metrics Details

Instance Metrics

The AWS/ApiGateway namespace includes the following instance Metrics.

Metric Description
4XXError The number of client errors captured during a given period. The Sum statistic represents this Metric, which is the total count of 4XXError errors during the given period. The Average statistic represents the 4XXError error rate, which is the total count of 4XXError errors divided by the total number of requests during the period. The denominator corresponds to the Count Metric (see below). Unit: Count
5XXError The number of server-side errors captured during a given period. The Sum statistic represents this Metric, which is the total count of 5XXError errors during the given period. The Average statistic represents the 5XXError error rate, which is the total count of 5XXError errors divided by the total number of requests during the period. The denominator corresponds to the Count Metric (see below). Unit: Count
Count The total number of API requests during a given period. The SampleCount statistic represents this Metric. Unit: Count
Latency The time elapsed from when API Gateway receives the request from the client to when it returns the response to the client. The latency includes integration latency and other API Gateway overhead. Unit: Millisecond

Object

The collected AWS API Gateway object data structure can be seen in 「Infrastructure - Custom」

{
  "measurement": "aws_gateway",
  "tags": {
    "account_name"   : "AWS",
    "api_name"       : "helloworld-API",
    "ApiId"          : "c72z3thtq8",
    "ApiKeySelectionExpression": "$request.header.x-api-key",
    "class"          : "aws_gateway",
    "cloud_provider" : "aws",
    "create_time"    : "2023/08/07 14:29:19",
    "CreatedDate"    : "2022-11-11T09:17:35Z",
    "date"           : "2023/08/07 14:29:19",
    "date_ns"        :"0",
    "Description"    :"Created by AWS Lambda",
    "instance_tags"  :"{}",
    "name"           :"c72z3thtq8",
    "ProtocolType"   :"HTTP",
    "region_id"      :"cn-northwest-1"
  }
}

Note: The fields in tags and fields may change with subsequent updates

Tip 1: The ApiId value is the instance ID, which serves as the unique identifier.