Collector Configuration Manual for "Alibaba Cloud - Billing (Instance Level)"
Before reading this, please read the following first:
Before using this collector, you must install the 'Integration Core Package' and its corresponding third-party dependency packages
To ensure data integrity, the billing data collected will be the data from one day before the collection date
1. Configuration Structure
This collector does not require configuration.
After data is synchronized successfully, it can be viewed in the "Cloud Bill Explorer" of TrueWatch.
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
21
22
23
24
25
26
27
28
29 | {
"category": "cloud_billing",
"fields": {
"amount": 0.12,
"cash_amount": 0.0,
"coupon_amount": 0.0,
"credit_amount": 0.0,
"message": "{\"BillingDate\": \"2024-11-10\", \"BillingItem\": \"\", \"BillingType\": \"\\u5176\\u5b83\", \"CommodityCode\": \"slb_intl\", \"CostUnit\": \"\\u672a\\u5206\\u914d\", \"Currency\": \"USD\", \"DeductedByCoupons\": 0.0, \"DeductedByResourcePackage\": \"\", \"InstanceConfig\": \"\\u53ef\\u7528\\u533a\\u7c7b\\u578b:\\u591a\\u53ef\\u7528\\u533a;\\u5b9e\\u4f8b\\u7c7b\\u578b:\\u516c\\u7f51;\\u5730\\u57df:\\u65b0\\u52a0\\u5761;\\u5b9e\\u4f8b\\u8ba1\\u8d39\\u65b9\\u5f0f:\\u6309\\u4f7f\\u7528\\u91cf\\u8ba1\\u8d39;\\u516c\\u7f51\\u6d41\\u91cf\\u8d39:\\u6309\\u4f7f\\u7528\\u6d41\\u91cf\\u8ba1\\u8d39GB;yundun_service:\\u5f00\\u901a;\\u5b9e\\u4f8b\\u8d39:\\u662f;\\u5bb9\\u91cf\\u5355\\u4f4d:1;\\u8ba1\\u8d39\\u5468\\u671f:\\u6309\\u5c0f\\u65f6;IP\\u7248\\u672c:IPv4;\\u5907\\u53ef\\u7528\\u533a:ap-southeast-1c;\\u8ba1\\u8d39\\u9879:\\u914d\\u7f6e\\u8d39\\u7528+\\u6d41\\u91cf\\u8d39\\u7528;\\u4e3b\\u53ef\\u7528\\u533a:ap-southeast-1b\", \"InstanceID\": \"lb-gs5v2g2irfujv93hr3k0l\", \"InstanceSpec\": \"slb.s3.large\", \"InternetIP\": \"47.245.99.230\", \"IntranetIP\": \"\", \"InvoiceDiscount\": 0.0774, \"Item\": \"PayAsYouGoBill\", \"ListPrice\": \"\", \"ListPriceUnit\": \"\", \"NickName\": \"fileshow\", \"OwnerID\": \"5451716195367166\", \"PipCode\": \"slb\", \"PretaxAmount\": 0.12, \"PretaxGrossAmount\": 0.258, \"ProductCode\": \"slb\", \"ProductDetail\": \"\\u4f20\\u7edf\\u578b\\u8d1f\\u8f7d\\u5747\\u8861 (\\u6309\\u91cf\\u4ed8\\u8d39) \\u56fd\\u9645\\u7ad9\", \"ProductName\": \"\\u8d1f\\u8f7d\\u5747\\u8861\", \"ProductType\": \"\", \"Region\": \"\\u65b0\\u52a0\\u5761\", \"ResourceGroup\": \"default resource group\", \"ServicePeriod\": \"86400\", \"ServicePeriodUnit\": \"\\u79d2\", \"SubscriptionType\": \"PayAsYouGo\", \"Tag\": \"\", \"Usage\": \"\", \"UsageUnit\": \"\", \"Zone\": \"ap-southeast-1b\"}",
"offical_amount": 0.258,
"stored_card_amount": 0.0
},
"measurement": "cloud_billing",
"tags": {
"account_id": "5539882238131171",
"account_name": "[email protected]",
"billing_date": "2024-11-10",
"billing_id": "a202af3e367140098dbf703e4c4e772642930c009b2e26051962dd14477c4417",
"billing_timestamp": "1731254399",
"cost_unit": "Not allocated",
"instance_id": "lb-gs5v2g2irfujv93hr3k0l",
"name": "lb-gs5v2g2irfujv93hr3k0l",
"product_code": "slb",
"product_name": "Load Balancer",
"region_id": "Singapore",
"subscription_type": "PayAsYouGo",
"zone": "ap-southeast-1b"
},
"timestamp": 1731254399
}
|
Fields in tags and fields may change with subsequent updates
3. Field Description
|
Reported Fields |
API Returned Fields |
Meaning of API Fields |
Bill ID |
billing_id |
|
Unique bill ID |
Product Code |
product_code |
ProductCode |
Product code |
Product Name |
product_name |
ProductName |
Product name |
Original Price |
official_amount |
PretaxGrossAmount |
Official price |
Paid Amount |
amount |
PretaxAmount |
User payment amount |
Credit Refund |
credit_amount |
AdjustAmount |
Credit refund |
Coupon Amount |
coupon_amount |
DeductedByCashCoupons |
Coupon deduction |
Stored Card Amt |
stored_card_amount |
DeductedByPrepaidCard |
Stored card deduction |
Cash Payment |
cash_amount |
CashAmount |
Cash payment (excluding credit refunds) |
Instance ID |
instance_id |
InstanceID |
Instance ID |
Billing Period |
billing_date |
|
Resource consumption record date. Format: YYYYMMDD |
Billing Period |
timestamp |
|
Resource consumption record date (timestamp) |
Financial Unit |
cost_unit |
AliyunCostUnit |
Financial unit |
Region |
region_id |
AliyunRegion |
Region |
Availability Zone |
zone |
AliyunZone |
Availability zone |
Subscription Type |
subscription_type |
AliyunSubscriptionType |
Subscription type |
Account Name |
account_name |
BillAccountName |
Account name |
Account ID |
account_id |
BillAccountID |
Account ID |
4. Linkage with Custom Object Collectors
When other custom object collectors (such as ECS, RDS) are running in the same DataFlux Func, this collector will automatically attempt to match the InstanceID
field with the tags.name
field in custom objects. If a successful match is made, all fields in the matched custom object's tags
, except for name
, will be added to the tags
section of the billing data.
Assume the original billing data collected is as follows:
JSON |
---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 | {
"measurement": "cloud_billing",
"tags": {
"product_code": "ecs",
"product_name": "Cloud Server ECS",
"name" : "i-xxxxxxxx",
"billing_date" : "20220909",
"cloud_provider" : "aliyun",
"account_id" : "xxxxx",
"account_name": "xxxxx"
},
"fields": {
"amount" : 9419.23,
"offical_amount": 18843.258604
},
"timestamp": 1657507021
}
|
Meanwhile, the custom object data collected by the Alibaba Cloud ECS collector is as follows:
JSON |
---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14 | {
"measurement": "aliyun_ecs",
"tags": {
"account_name": "xxxxxx",
"account_id" : "xxxxxx",
"name" : "i-xxxxxxxx",
"InstanceId" : "i-xxxxxxxx",
"RegionId" : "cn-hangzhou",
"{other fields}" : "{omitted}"
},
"fields": {
"{other fields}": "{omitted}"
}
}
|
Thus, the final reported billing data would be as follows:
JSON |
---|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 | {
"measurement": "cloud_billing",
"tags": {
"account_id" : "xxxxx",
"account_name": "xxxxx",
"instance_id" : "i-xxxxxxxx",
"region_id" : "cn-hangzhou",
"product_code": "ecs",
"product_name": "Cloud Server ECS",
"name" : "i-xxxxxxxx",
"billing_date" : "20220909",
"cloud_prvider" : "aliyun",
"{other fields}" : "{omitted}"
},
"fields": {
"amount" : 9419.23,
"offical_amount": 18843.258604
},
"timestamp": 1657507021
}
|
Appendix
Alibaba Cloud - Billing Management « Query Instance Billing Service »