Skip to content

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

Install Script

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

  1. Log in to the Func console, click on 【Script Market】, and enter the Guance Script Market to search for: integration_alibabacloud_api_gateway

  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 Guance, check if asset information exists in 「Infrastructure / Custom」.
  3. 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 tags and fields may change with subsequent updates.

Feedback

Is this page helpful? ×