Collector Configuration Manual for Alibaba Cloud Billing (Instance Dimension)¶
Before reading this document, please read:
Tip
Before using this collector, you must install the "Integration Core Package" and its accompanying third-party dependencies.
Tip
To ensure data integrity, the billing data collected is for the day before the collection date.
1. Configuration Structure¶
This collector does not require configuration.
2. Data Reporting Format¶
After data is successfully synchronized, you can view the data in the "Cloud Billing Explorer" of TrueWatch.
An example of the reported data is as follows:
{
"category": "cloud_billing",
"fields": {
"amount": 0.12,
"cash_amount": 0.0,
"coupon_amount": 0.0,
"credit_amount": 0.0,
"message": "{message}",
"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": "xxx",
"instance_id": "lb-gs5v2g2irfujv93hr3k0l",
"name": "lb-gs5v2g2irfujv93hr3k0l",
"product_code": "slb",
"product_name": "slb",
"region_id": "ap-southeast-1",
"subscription_type": "PayAsYouGo",
"zone": "ap-southeast-1b"
},
"timestamp": 1731254399
}
Note
The fields in tags and fields may change with subsequent updates.
3. Field Descriptions¶
Reported Field | API Returned Field | API Field Meaning | |
---|---|---|---|
Billing ID | billing_id |
Unique billing ID | |
Product Code | product_code |
ProductCode |
Product code |
Product Name | product_name |
ProductName |
Product name |
Official Price | official_amount |
PretaxGrossAmount |
Official website price |
Actual Payment | amount |
PretaxAmount |
User payment price |
Credit Refund | credit_amount |
AdjustAmount |
Credit refund deduction |
Coupon Amount | coupon_amount |
DeductedByCashCoupons |
Coupon deduction |
Stored Card Amount | stored_card_amount |
DeductedByPrepaidCard |
Stored card deduction |
Cash Payment | cash_amount |
CashAmount |
Cash payment (excluding credit refund deduction). |
Instance ID | instance_id |
InstanceID |
Instance ID |
Billing Period | billing_date |
Date of resource consumption record. Format: YYYYMMDD | |
Billing Period | timestamp |
Date of resource consumption record (timestamp) | |
Cost Unit | cost_unit |
AliyunCostUnit |
Cost unit |
Region | region_id |
AliyunRegion |
Region |
Zone | zone |
AliyunZone |
Zone |
Subscription Type | subscription_type |
AliyunSubscriptionType |
Subscription type |
Account Name | account_name |
BillAccountName |
Account name |
Account ID | account_id |
BillAccountID |
Account ID |
4. Interaction with Custom Object Collectors¶
When other custom object collectors (such as ECS, RDS) are running in the same DataFlux Func, this collector will automatically try to match the InstanceID
field with the tags.name
field in the custom objects. When a match is successful, it will add all fields from the custom object tags
except name
to the billing data tags
.
Assume the original billing data collected is as follows:
{
"measurement": "cloud_billing",
"tags": {
"product_code": "ecs",
"product_name": "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
}
At the same time, the Alibaba Cloud ECS collector collects custom object data as follows:
{
"measurement": "aliyun_ecs",
"tags": {
"account_name": "xxxxxx",
"account_id" : "xxxxxx",
"name" : "i-xxxxxxxx",
"InstanceId" : "i-xxxxxxxx",
"RegionId" : "cn-hangzhou",
"{others}" : "{...}"
},
"fields": {
"{others}". : "{...}"
}
}
Then, the final reported billing data will be as follows:
{
"measurement": "cloud_billing",
"tags": {
"account_id" : "xxxxx",
"account_name" : "xxxxx",
"instance_id" : "i-xxxxxxxx",
"region_id" : "cn-hangzhou",
"product_code" : "ecs",
"product_name" : "ECS",
"name" : "i-xxxxxxxx",
"billing_date" : "20220909",
"cloud_prvider": "aliyun",
"{others}" : "{...}"
},
"fields": {
"amount" : 9419.23,
"offical_amount": 18843.258604
},
"timestamp": 1657507021
}