Skip to content

Configuration Manual for Collector 「Tencent Cloud-EIP」

Before reading this, please first read:

Before using this collector, the installation of the 「Core Integration Package」 and its associated third-party dependency packages is required

1. Configuration Structure

The configuration structure for this collector is as follows:

Field Type Required Description
regions list Required List of regions to be collected
regions[#] str Required Region ID. For example: 'ap-shanghai'
See appendix for the complete 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, allowing users to filter target resources by object properties. The filter function returns True or False.

  • True: Target resource needs to be collected.
  • False: Target resource does not need to be collected.

Supported object properties for filtering:

Property Description
AddressId EIP's ID
AddressName EIP Name
AddressStatus EIP Status
AddressIp External IP address
AddressType Instance name
InternetServiceProvider Carrier information for Elastic Public IP
InternetChargeType Network billing mode for Elastic Public IP
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example: Enable filter based on AddressId and AddressStatus properties of the object, configuration format as follows:
# Instance filter

def filter_instance(instance):
    '''
    Collect EIP instances with AddressId eip-xxxxxxx, eip-yyyyyyy and AddressStatus UNBIND (unbound)
    '''
    address_id = instance['AddressId']
    address_status = instance['AddressStatus']
    if address_id in ['eip-xxxxxxx', 'eip-yyyyyyy'] and address_status in ['UNBIND']:
        return True
    return False

from guance_integration__runner import Runner
import guance_tencentcloud_eip__main as main

@DFF.API('TencentCloud-EIP Collection', timeout=3600, fixed_crontab='*/15 * * * *')
def run():
    Runner(main.DataCollector(account, collector_configs, filters=[filter_instance])).run()

3. Data Reporting Format

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

Example of reported data:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "measurement": "tencentcloud_eip",
  "tags": {
    "name"                    : "eip-xxxxxx",
    "RegionId"                : "ap-shanghai",
    "AddressId"               : "ap-shanghai-1",
    "AddressName"             : "xxxx",
    "AddressStatus"           : "BIND",
    "AddressIp"               : "119.45.172.244",
    "AddressType"             : "EIP",
    "InternetServiceProvider" : "BGP",
    "InternetChargeType"      : "TRAFFIC_POSTPAID_BY_HOUR"
  },
  "fields": {
    "IsEipDirectConnection" : false,
    "IsArrears"             : false,
    "IsBlocked"             : false,
    "InstanceId"            : "ins-mmxxxx",
    "NetworkInterfaceId"    : "eni-8xxxxx",
    "PrivateAddressIp"      : "10.206.0.16",
    "CreatedTime"           : "2024-06-11T08:10:57Z",
    "CascadeRelease"        : false,
    "LocalBgp"              : false,
    "Bandwidth"             : 1,
    "EipAlgType"            : "{EIP ALG开启的协议类型}",
    "message"               : "{Instance JSON data}"
  }
}

Fields in tags and fields may change with subsequent updates

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

fields.message and fields.EipAlgType are both strings after JSON serialization

X. Appendix

Refer to the official Tencent Cloud documentation: