Skip to content

Collector Configuration Manual for "Tencent Cloud-CLB"

Before reading this, please first read:

Before using this collector, you must install the 'Integration Core Package' and its associated third-party dependency packages

1. Configuration Structure

The configuration structure of this collector is as follows:

Field Type Required Description
regions list Required List of regions to collect data from
regions[#] str Required Region ID. For example: 'ap-shanghai'
Refer to the appendix for the full list

2. Configuration Example

Specifying Regions

Collect data from Shanghai and Guangzhou regions.

Python
1
2
3
collector_configs = {
    'regions': [ 'ap-shanghai', 'ap-guangzhou' ]
}

Configuring Filters (Optional)

This collector script supports user-defined filters that allow users to filter target resources based on object properties. The filter function returns True or False. - True: The target resource needs to be collected. - False: The target resource does not need to be collected.

Supported object properties for filtering:

Property Description
LoadBalancerId Load balancer instance ID
LoadBalancerName Load balancer instance name
LoadBalancerType Network type of the load balancer instance
Address VIP of the load balancer instance
Status Status of the load balancer instance
VpcId ID of the private network to which the load balancer instance belongs
Zone Availability zone of the load balancer instance
ChargeType Billing type of the load balancer instance
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example: Enable the filter based on the LoadBalancerId and VpcId properties of the object, with the following configuration format:

def filter_load_balance(loadBalance):
    '''
    return True|False
    '''
    # return True
    load_balance_id = loadBalance['LoadBalancerId']
    vpc_id = loadBalance['VpcId']
    if load_balance_id in ['xxx'] and vpc_id in ['yyy']:
        return True
    return False

###### Do not modify the following contents #####
from guance_integration__runner import Runner
import guance_tencentcloud_clb__main as main

def run():
    Runner(main.DataCollector(account, collector_configs, filters=[filter_load_balance])).run()

3. Data Reporting Format

After data synchronization, you can view the data in the "Infrastructure - Resource Catalog" section of {{( brand_name }}}.

An example of the reported data is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
  "measurement": "tencentcloud_clb",
  "tags": {
    "name"            : "lb-xxxx",
    "RegionId"        : "ap-shanghai",
    "LoadBalancerId"  : "lb-xxxx",
    "LoadBalancerName": "lb-xxxx",
    "Address"         : "81.xxxx",
    "LoadBalancerType": "Public",
    "Status"          : "1",
    "VpcId"           : "vpc-xxxx",
    "Zone"            : "ap-shanghai-3",
    "ChargeType"      : "POSTPAID_BY_HOUR"
  },
  "fields": {
    "CreateTime": "2022-04-27 15:19:49",
    "listeners" : "{JSON data for listeners}",
    "message"   : "{JSON data for instance}"
  }
}

Descriptions of some parameters are as follows:

tags.LoadBalancerType (Network type of the load balancer instance) value meanings:

Value Description
Public Public attribute
Private Internal attribute

tags.Status (Status of the load balancer instance) value meanings:

Value Description
0 Creating
1 Running normally

Fields in tags and fields may change with subsequent updates

The value of tags.name is the instance ID, used as a unique identifier

fields.message is a JSON serialized string

X. Appendix

Refer to the official Tencent Cloud documentation: