Skip to content

Tencent Cloud NAT Gateway

Collects instance status, public bandwidth, connection utilization, and drops caused by exceeded limits for Tencent Cloud public NAT gateways. Use these metrics to identify bandwidth, connection, or SNAT port capacity bottlenecks.

Configuration

Permissions

Grant the collection account the read-only permissions listed below.

  • vpc:DescribeNatGateways: Retrieves NAT gateways in the specified region, including their specifications, status, and address translation settings.
  • monitor:DescribeBaseMetrics: Retrieves Cloud Monitor metric dimensions, supported periods, and aggregation methods.
  • monitor:GetMonitorData: Retrieves one-minute gateway metric data by natId.

Install Func

We recommend enabling Hosted Func in Guance under Integrations > Extensions > Hosted Func.

If you run your own Func instance, see Deploy Func yourself.

Enable the Script

Before you start, have your Tencent Cloud SecretId and SecretKey ready and grant the required permissions.

Enable the Script in Hosted Func

  1. Sign in to the Guance console.
  2. In Integrations, select Cloud Account Management.
  3. Click Add Cloud Account, select Tencent Cloud, and fill in the required information. Skip this step if the account is already configured.
  4. Click Test. If the test succeeds, click Save. If it fails, check the settings and try again.
  5. In the Cloud Account Management list, click the added account to open its details page.
  6. On the account details page, click Integrations, find Tencent Cloud NAT Gateway under Not Installed, and click Install. Select the gateway region and the metrics to collect. Collection runs once per minute by default.

Enable the Script Manually

  1. In the Func console, click Script Market and search for integration_tencentcloud_nat_gateway in the Guance Script Market.

  2. Click Install and enter your Tencent Cloud SecretId, SecretKey, account name, and collection regions.

  3. Click Deploy Startup Script. Func automatically creates the Startup script set and configures the corresponding startup script.

  4. After enabling the script, open Management > Automatic Trigger Configuration to see its trigger. Click Run to execute it immediately. After a short wait, check the execution history and logs.

Verify

  1. In Management > Automatic Trigger Configuration, verify that the task has an automatic trigger. Check its execution history and logs for errors.
  2. In Guance, open Infrastructure > Custom to verify that a tencentcloud_nat_gateway object exists, then check the gateway ID and region.
  3. In Guance, open the tencentcloud_QCE/NAT_GATEWAY measurement under Metrics and verify the one-minute data by natId.

Metrics

The Cloud Monitor namespace is QCE/NAT_GATEWAY, and collection uses the natId dimension. The hosted collection package selects the 14 metrics marked “Default” below for the built-in view and monitors. The form uses the original Tencent Cloud metric names. A suffix identifying the one-minute cloud aggregation is appended when writing each metric to the measurement. The included manual startup script selects all 23 metrics. For metrics and aggregation methods supported by each gateway specification, see Tencent Cloud NAT Gateway monitoring metrics.

Filter the view by cloud account, region, and gateway ID. The top row shows the available gateway count reported by the cloud, peak egress bandwidth during the selected period, peak outbound bandwidth utilization, and peak drop rate at the concurrent connection limit. The monitors check egress bandwidth, concurrent connection capacity, drops at the concurrent connection limit, and SNAT port allocation failures in five-minute intervals.

Metric Description Type Unit
OutBandwidth_sum Default · Public egress bandwidth float Mbps
InBandwidth_sum Default · Public ingress bandwidth float Mbps
Egressbandwidthusage_expr Default · Egress bandwidth as a percentage of the limit for the gateway specification float %
WanInByteUsage_expr Default · Ingress bandwidth as a percentage of the limit for the gateway specification float %
Conns_max Default · Peak concurrent connections within one minute float count
ConnsUsage_expr Default · Concurrent connections as a percentage of the limit for the gateway specification float %
ActiveConns_max Default · Peak active connections, Standard gateways float count
InactiveConns_expr Default · Inactive connections, Standard gateways float count
SnatPortMaxUsage_max Default · Highest SNAT port utilization for a single destination, including system probe traffic, Standard gateways float %
ConnsDropRate_expr Default · Connection drop rate when the concurrent connection quota is exceeded float connections/s
IncreasedConnDropRate_expr Default · Connection drop rate when the new connection rate quota is exceeded, Standard gateways float connections/s
WanInDropPkg_sum Default · Packet drop rate after reaching the ingress bandwidth limit float packets/s
WanOutDropPkg_sum Default · Packet drop rate after reaching the egress bandwidth limit float packets/s
SnatConnDropPkg_sum Default · Total packets dropped in the minute due to SNAT port allocation failures float packets
InPkg_sum Optional · Average inbound public packets per second float packets/s
OutPkg_sum Optional · Average outbound public packets per second float packets/s
IncreasedConnNum_max Optional · Average new connections per second, Standard gateways float connections/s
IncreasedConnUsage_expr Optional · New connection rate as a percentage of the limit for the gateway specification, Standard gateways float %
Droppkg_last Optional · Cumulative packet drops due to the concurrent connection limit, sampled at the end of the period float packets
PpsWanInDropPkg_sum Optional · Packets dropped during the period due to the inbound PPS limit, Standard gateways float packets
PpsWanOutDropPkg_sum Optional · Packets dropped during the period due to the outbound PPS limit, Standard gateways float packets

Objects

View collected Tencent Cloud NAT Gateway objects under Infrastructure > Custom. The example below uses sanitized values. Both name and NatGatewayId on the object correspond to natId in the metrics. Lists such as addresses, rules, and security groups are stored as JSON strings.

{
  "measurement": "tencentcloud_nat_gateway",
  "tags": {
    "name": "nat-xxxxxxxx",
    "NatGatewayId": "nat-xxxxxxxx",
    "NatGatewayName": "Example Gateway",
    "NatGatewayType": "ADVANCED",
    "RegionId": "ap-guangzhou",
    "Zone": "ap-guangzhou-7",
    "account_name": "example",
    "cloud_provider": "tencentcloud"
  },
  "fields": {
    "NatProductVersion": 2,
    "State": "AVAILABLE",
    "NetworkState": "AVAILABLE",
    "RestrictState": "NORMAL",
    "CreatedTime": "2026-01-01 00:00:00",
    "InternetMaxBandwidthOut": 5000,
    "MaxConcurrentConnection": 2000000,
    "PublicIpAddressSet": "[{\"AddressId\": \"eip-xxxxxxxx\", \"PublicIpAddress\": \"203.0.113.10\", \"IsBlocked\": false, \"BlockType\": \"\"}]",
    "DestinationIpPortTranslationNatRuleSet": "[]",
    "DirectConnectGatewayIds": "[]",
    "SecurityGroupSet": "[]",
    "SourceIpTranslationNatRuleSet": "[]",
    "VpcId": "vpc-xxxxxxxx",
    "message": "{\"NatGatewayId\":\"nat-xxxxxxxx\",\"State\":\"AVAILABLE\"}"
  }
}

Feedback

Is this page helpful?