Collector "Alibaba Cloud - Billing" Configuration Manual¶
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 date collected is current date - 2 days, i.e., data collected during 2022-07-03 00:00:00 ~ 23:59:59 will be for 2022-07-01. It is recommended to run this script once a day
Tip
The program has built-in duplicate collection prevention. If run multiple times within the same day, all executions after the first will automatically skip
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 "Metrics" of TrueWatch.
An example of the reported data is as follows:
{
"measurement": "cloud_bill",
"tags": {
"product_code": "ecs",
"product_name": "Elastic Compute Service",
"account_id" : "1234xxxxxx999",
"account_name": "xxxxx",
},
"fields": {
"amount" : 9419.23,
"offical_amount": 18843.258604
},
"timestamp": 1657507021
}
Note
Fields in tags and fields may change with subsequent updates
3. Statistical Explanation¶
Field | Reported Field | Alibaba Cloud API Return Field | Explanation |
---|---|---|---|
Product Code | product_code |
ProductCode |
|
Product Name | product_name |
ProductName |
|
Account Name | account_name |
AccountName |
|
Account ID | account_id |
AccountID |
|
Original Price | offical_amount |
PretaxGrossAmount |
Sum of PretaxGrossAmount for the same product code |
Payable Amount | amount |
PretaxAmount |
Sum of PretaxAmount for the same product code |
Billing Date | timestamp |
BillingDate |
Tip
Data granularity is Product Code: ProductCode; bills of the same type will be merged and calculated. Refer to the Alibaba Cloud API Raw Data and Script Aggregated Data for comparison
Tip
To ensure complete data reporting, the collector collects data for two days prior. For example, if the collector runs on 2022-07-03, it will collect data for 2022-07-01
Tip
Alibaba Cloud API refers to the Alibaba Cloud Billing Management 'Query Resource Consumption Records' interface. See the appendix for details
Alibaba Cloud Billing Raw Data¶
[
{
"BillingDate" : "2022-xx-xx",
"ProductCode" : "oss",
"ProductName" : "Block Storage",
"PretaxAmount" : 0.12,
"PretaxGrossAmount": 0.22,
"account_id" : "1234xxxxxx999",
"account_name" : "xxxxx",
"{Other Fields}" : "{Omitted}"
},
{
"BillingDate" : "2022-xx-xx",
"ProductCode" : "oss",
"ProductName" : "Block Storage",
"PretaxAmount" : 0.22,
"PretaxGrossAmount": 0.32,
"account_id" : "1234xxxxxx999",
"account_name" : "xxxxx",
"{Other Fields}" : "{Omitted}"
},
{
"BillingDate" : "2022-xx-xx",
"ProductCode" : "snapshot",
"ProductName" : "Block Storage",
"account_id" : "1234xxxxxx999",
"account_name" : "xxxxx",
"PretaxAmount" : 0.02,
"PretaxGrossAmount": 0.02,
"{Other Fields}" : "{Omitted}"
}
]
After Script Aggregation¶
[
{
"measurement": "cloud_bill",
"tags": {
"product_code": "oss",
"product_name": "Block Storage",
"account_id" : "1234xxxxxx999",
"account_name": "xxxxx",
},
"fields": {
"amount" : 0.34,
"offical_amount": 0.54,
"account_id" : "1234xxxxxx999",
"account_name" : "xxxxx",
},
"timestamp": 1657507021
},
{
"measurement": "cloud_bill",
"tags": {
"product_code": "snapshot",
"product_name": "Block Storage",
"account_id" : "1234xxxxxx999",
"account_name": "xxxxx",
},
"fields": {
"amount" : 0.02,
"offical_amount": 0.02
},
"timestamp": 1657507021
}
]