Skip to content

AWS API Gateway

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

Configuration

Install Func

It is recommended to activate Guance integration - extension - DataFlux Func (Automata): all prerequisites are automatically installed. Please continue with script installation.

If you deploy Func manually, refer to Manual Deployment of Func

Installation Script

Note: Please prepare an Amazon AK that meets the requirements in advance (for simplicity, you can directly grant global read-only permission ReadOnlyAccess).

Script for Activating Managed Version

  1. Log in to the Guance console.
  2. Click on the 【Integration】 menu, select 【Cloud Account Management】.
  3. Click 【Add Cloud Account】, choose 【AWS】, fill in the required information on the interface; if cloud account information has already been configured, skip this step.
  4. Click 【Test】, after a successful test click 【Save】. If the test fails, check whether the related configuration information is correct and retest.
  5. In the 【Cloud Account Management】 list, you can see the added cloud account. Click the corresponding cloud account to enter the details page.
  6. On the cloud account details page, click the 【Integration】 button. In the Not Installed list, find AWS API Gateway, click the 【Install】 button, and follow the prompts to install.

Manual Activation Script

  1. Log in to the Func console, click 【Script Market】, enter the official script market, search for guance_aws_gateway.
  2. After clicking 【Install】, input the corresponding parameters: AWS AK ID, AK Secret, and account name.
  3. Click 【Deploy Startup Script】, the system will automatically create a Startup script set and configure the corresponding startup script.
  4. After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to run immediately without waiting for the scheduled time. Wait a moment, then you can check the execution task records and corresponding logs.

Verification

  1. In 「Management / Automatic Trigger Configuration」 confirm whether the corresponding tasks have the relevant automatic trigger configurations. You can also check the corresponding task records and logs for any anomalies.
  2. In Guance, 「Infrastructure / Custom」 check if asset information exists.
  3. In Guance, 「Metrics」 check if there are corresponding monitoring data.

Metrics

After configuring Amazon-CloudWatch, the default Measurement set is as follows. More Metrics can be collected through configuration. Amazon CloudWatch Metrics Details

Instance Metrics

The AWS/ApiGateway namespace includes the following instance Metrics.

Metric Description
4XXError Captures the number of client errors during a given period. The Sum statistic represents this Metric, i.e., the total count of 4XXError errors during the period. The Average statistic represents the 4XXError error rate, i.e., 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 Captures the number of server-side errors during a given period. The Sum statistic represents this Metric, i.e., the total count of 5XXError errors during the period. The Average statistic represents the 5XXError error rate, i.e., 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 Total number of API requests during a given period. The SampleCount statistic represents this Metric. Unit: Count
Latency Time taken from when the API Gateway receives a request from the client until it returns the response to the client. Latency includes integration latency and other API Gateway overheads. Unit: Millisecond

Objects

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: Fields in tags and fields may change with subsequent updates.

Note 1: The value of ApiId is the instance ID, used for unique identification.

Feedback

Is this page helpful? ×