Skip to content

Alibaba Cloud API Gateway

Collect monitoring data for instances, API groups, and APIs in Alibaba Cloud's original API Gateway (Classic).

Product Retirement and Migration

According to Alibaba Cloud's official retirement announcement, the original API Gateway will be retired according to the following timeline (Beijing Time, UTC+08):

Date and time Impact
August 23, 2026, 00:00 New instance purchases will no longer be available.
March 21, 2027, 00:00 Subscription instances can no longer be renewed. You can convert them to pay-as-you-go to continue using them; pay-as-you-go instances are unaffected during this phase.
September 21, 2027, 00:00 The service will be fully discontinued, including the product console, technical support, and ticket services.

This integration collects existing resources from the original API Gateway. Before the service is fully discontinued, migrate your workloads to Alibaba Cloud Cloud-native API Gateway, then install the corresponding integration as described in the Alibaba Cloud Cloud-native API Gateway documentation. Installing the integration only configures data collection; it does not migrate cloud resources or workloads.

Configuration

Install Func

It is recommended to activate the TrueWatch Integration - Extensions - DataFlux Func (Automata)

If deploying Func by yourself, refer to Deploy Func by Yourself

Activate Script

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

Automata 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 【Alibaba Cloud】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore 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 test again
  5. Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
  6. Click the 【Integration】 button on the cloud account details page, find Alibaba Cloud 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】, and enter the TrueWatch script market. Search for: integration_alibabacloud_apigateway

  2. Click 【Install】, then enter the corresponding parameters: Alibaba Cloud 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 「Manage / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute once without waiting for the scheduled time. After a while, you can view the execution task records and corresponding logs.

Verification

  1. In 「Manage / 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 for any exceptions.
  2. In TrueWatch, check if asset information exists in 「Infrastructure / Custom」.
  3. In TrueWatch, check if there is corresponding monitoring data in 「Metrics」.

Metrics

After configuring Alibaba Cloud Cloud Monitor, the default Measurement is as follows. More metrics can be collected through configuration. Alibaba Cloud Cloud Monitor Metrics Details

API Gateway

MetricName Metric Type MetricDescribe Dimensions Statistics Unit
Latency Instance Dimension Response Time userId,region,apiUid Average ms
SumQPS Instance Dimension Total Requests userId,region,apiUid Count count
TrafficRX Instance Dimension Inbound Traffic userId,region,apiUid Sum B
TrafficTX Instance Dimension Outbound Traffic userId,region,apiUid Sum B
code2XX Instance Dimension 2XX Response Code Count userId,region,apiUid Value count
code429 Instance Dimension 429 Response Code Count userId,region,apiUid Value count
code4XX Instance Dimension 4XX Response Code Count userId,region,apiUid Value count
code5XX Instance Dimension 5XX Response Code Count userId,region,apiUid Value count
error_count_instance apigateway Instance Request Error Count userId,region,apiUid Sum count
instance_lost apigateway Instance Node Loss Ratio userId,region,instanceId Average %
request_count_instance apigateway Instance Total Request Count userId,region,instanceId Sum count

API Group

MetricName Metric Type MetricDescribe Dimensions Statistics Unit
Latency_group apiGroupUid Response Time userId,region,apiGroupUid Average ms
SumQPS_group apiGroupUid Total Requests userId,region,apiGroupUid Count count
TrafficRX_group apiGroupUid Inbound Traffic userId,region,apiGroupUid Sum B
TrafficTX_group apiGroupUid Outbound Traffic userId,region,apiGroupUid Sum B
code2XX_group apiGroupUid 2XX Response Code Count userId,region,apiGroupUid Value count
code429_group apiGroupUid 429 Response Code Count userId,region,apiGroupUid Value count
code4XX_group apiGroupUid 4XX Response Code Count userId,region,apiGroupUid Value count
code5XX_group apiGroupUid 5XX Response Code Count userId,region,apiGroupUid Value count

API Instance

MetricName Metric Type MetricDescribe Dimensions Statistics Unit
Latency_instance Instance Dimension Response Time userId,region,instanceId Average ms
SumQPS_instance Instance Dimension Total Requests userId,region,instanceId Count count
TrafficRX_instance Instance Dimension Inbound Traffic userId,region,instanceId Sum B
TrafficTX_instance Instance Dimension Outbound Traffic userId,region,instanceId Sum B
code2XX_instance Instance Dimension 2XX Response Code Count userId,region,instanceId Value count
code429_instance Instance Dimension 429 Response Code Count userId,region,instanceId Value count
code4XX_instance Instance Dimension 4XX Response Code Count userId,region,instanceId Value count
code5XX_instance Instance Dimension 5XX Response Code Count userId,region,instanceId Value count

Object

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

{
  "measurement": "aliyun_apigateway",
  "tags": {
    "instance_spec"             : "api.s1.small",
    "instance_name"             : "xxxx-test",
    "instance_id"               : "i-xxxxx",
    "region_id"                 : "cn-hangzhou"
  },
  "fields": {
    "zone_local_name"                   : "xxxxx",
    "internet_egress_address"           : "114.55.1xx.xxx",
    "created_time"                     : "2025/09/01 16:10:09",
    "vpc_egress_address"                : "100.xxx.xxx.0/xx",
    "instance_spec_attributes"          : "xxxxx",
    "instance_charge_type"              : "PayAsYouGo",
    "vpc_slb_intranet_enable"            : "False",
    "instance_type"                    : "VPC_SHARED",
    "status"                          : "RUNNING",
    "zone_id"                          : "cn-hangzhou",
    "instance_cidr_block"               : "172.16.xx.xx/xx",
    "ipv_6_acl_status"                   : "off",
    "egress_ipv_6_enable"                : "False",
    "maintain_start_time"               : "18:00Z",
    "maintain_end_time"                 : "22:00Z"
  }
}

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