Alibaba Cloud API Gateway
Collect Alibaba Cloud API Gateway monitoring data
Configuration¶
Install Func¶
It is recommended to activate the Guance 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¶
- Log in to the Guance console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- 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
- 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
- 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
- Click the 【Integration】 button on the cloud account details page, find
Alibaba Cloud API Gatewayunder theNot Installedlist, and click the 【Install】 button to pop up the installation interface for installation.
Manual Activation Script¶
-
Log in to the Func console, click 【Script Market】, and enter the Guance script market. Search for:
integration_alibabacloud_apigateway -
Click 【Install】, then enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.
-
Click 【Deploy Startup Script】, the system will automatically create a
Startupscript set and configure the corresponding startup script. -
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¶
- 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.
- In Guance, check if asset information exists in 「Infrastructure / Custom」.
- In Guance, 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
tagsandfieldsmay change with subsequent updates.