Collector 'Alibaba Cloud-EIP' Configuration Manual¶
Before reading this document, please read:
Tip
Before using this collector, you must install the 'Integration Core Core Package' and its accompanying third-party dependencies.
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. Example: 'cn-hangzhou' See appendix for full list |
2. Configuration Examples¶
Specify Regions¶
Collect data from Hangzhou and Shanghai regions
Configure Filters (Optional)¶
This collector script supports custom filters, allowing users to filter target resources based on object attributes. The filter function returns True or False.
-
True: The target resource should be collected.
-
False: The target resource should not be collected.
Supported object attributes for filtering:
Attribute | Description |
---|---|
AllocationId | EIP Instance ID |
Name | EIP Name |
IpAddress | EIP IP Address |
Status | EIP Status |
# Example: Enable filter and filter based on instance ID and name attributes. Configuration format is as follows:
def filter_instance(instance):
'''
Collect instances with AllocationId as xxxxx or Name as xxxxx
'''
# return True
allocation_id = instance['AllocationId']
eip_name = instance['Name']
if allocation_id in ['xxxxx'] or eip_name in ['xxxxx']:
return True
return False
###### Do not modify the following contents #####
from integration_core__runner import Runner
import integration_alibabacloud_eip__main as main
@DFF.API('AlibabaCloud-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 is successfully synchronized, it can be viewed in the 'Infrastructure-Resource Catalog' of TrueWatch.
Example of reported data:
{
"measurement": "aliyun_eip",
"tags": {
"name" : "eip-xxxxx",
"AllocationId" : "eip-bp1lfsikwo4roa0mcqg9u",
"EIPName" : "",
"Status" : "InUse",
"RegionId" : "cn-hangzhou",
"IpAddress" : "47.96.22.249",
},
"fields": {
"Bandwidth" : "1",
"InternetChargeType": "PayByTraffic",
"BusinessStatus" : "Normal",
"ChargeType" : "PostPaid",
"AllocationTime": "2022-01-20T03:06:51Z",
"ExpiredTime" : "",
"message" : "{Instance JSON Data}"
}
}
Some parameter descriptions:
tags.InternetChargeType
(Billing Type) value meanings:
Value | Description |
---|---|
PayByBandwidth |
Pay by fixed bandwidth |
PayByTraffic |
Pay by traffic usage |
tags.ChargeType
(Billing Mode) value meanings:
Value | Description |
---|---|
PrePaid |
Prepaid |
PostPaid |
Pay-as-you-go |
tags.Status
(Billing Mode) value meanings:
Value | Description |
---|---|
Associating |
Associating |
Unassociating |
Unassociating |
InUse |
In use |
Available |
Available |
Releasing |
Releasing |
Note
Fields in tags and fields may change with subsequent updates.
Tip
The value of tags.name is the instance ID, which serves as a unique identifier. fields.message is a JSON serialized string.
X. Appendix¶
Please refer to the official Alibaba Cloud documentation: