Skip to content

Configuration Manual for the "Tencent Cloud - Billing (Instance Level)" Collector

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 date collected is the day before the current date

Currently supported Tencent Cloud collectors include cdb, clb, cos, cvm, mongodb, redis

1. Configuration Structure

No configuration required for this collector.

2. Data Reporting Format

After successful synchronization of data, it can be viewed in the 'Cloud Billing Explorer' of TrueWatch.

An example of 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
{
  "measurement": "cloud_billing",
  "tags": {
    "billing_id"    : "anvxfafakjflxxxxxxx",
    "account_id"    : "100025xxxxxx113474",
    "account_name"  : "100025xxxxxx113474",
    "product_code"  : "mongodb",
    "product_name"  : "Cloud Database TencentDB for MongoDB",
    "region_id"     : "cn-shenzhen-1",
    "instance_id"   : "cmgo-xxxxxx",
    "cloud_provider": "tencentcloud",
    "billing_date"  : "2022-09-12",
    "name"          : "cmgo-xxxxxx"
  },
  "fields": {
    "amount"        : 13.25492784,
    "offical_amount": 13.25492784
  },
  "timestamp": 1662940800
}

Fields in tags and fields may change with subsequent updates

3. Field Description

Reported Field API Return Field Description
Bill ID billing_id Unique bill ID
Product Code product_code BusinessCode Extracted from BusinessCode
For example: "p_mongodb" -> "mongodb"
Product Name product_name BusinessCodeName
Original Price offical_amount ComponentSet.Cost
Region region_id Region Region
Paid Amount amount CashPayAmount
+ VoucherPayAmount
Cash payment
+ Voucher payment
Bill Date billing_date Query date (in YYYY-MM-DD format, manually added)
Instance ID instance_id ResourceId
Customer Account ID account_id PayerUin Log into Tencent Cloud, find the avatar at the top-right corner - Access Management - Users - User List to see account name, account ID information
Customer Account Name account_name Interface ListUsers.Name field or PayerUin field The ListUsers interface returns all sub-user information, matching the PayerUin field returned by the bill interface with the Uin field returned by the ListUsers interface to obtain the corresponding Name field. If no match is found, use PayerUin by default

Data granularity is Instance ID: InstanceID

Consumption amounts with the same Instance ID will be combined, one product may correspond to multiple components (ComponentSet), so all components need to be aggregated before assigning values. For more details, refer to the comparison between the Original Tencent Cloud API Data and the Script Aggregated Data below.

Data Returned by the Tencent Cloud Query Bill Detail (DescribeBillDetail) Interface

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
30
31
32
33
34
35
36
37
38
[
  {
    "BusinessCodeName": "Cloud Database TencentDB for MongoDB",
    "BusinessCode"    : "p_mongodb",
    "ComponentSet": [
      {
        "Cost"            : "0.20000000",
        "VoucherPayAmount": "0",
        "CashPayAmount"   : "0.20000000",
        "{Other Fields}"  : "{Omitted}"
      },
      {
        "Cost"            : "0.10000000",
        "VoucherPayAmount": "0",
        "CashPayAmount"   : "0.10000000",
        "{Other Fields}"  : "{Omitted}"
      }
    ]
  },
  {
    "BusinessCodeName": "Cloud Database TencentDB for MongoDB",
    "BusinessCode"    : "p_mongodb",
    "ComponentSet": [
      {
        "Cost"            : "0.10000000",
        "VoucherPayAmount": "0",
        "CashPayAmount"   : "0.10000000",
        "{Other Fields}"  : "{Omitted}"
      },
      {
        "Cost"            : "0.30000000",
        "VoucherPayAmount": "0",
        "CashPayAmount"   : "0.30000000",
        "{Other Fields}"  : "{Omitted}"
      }
    ]
  }
]

After Script Aggregation

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[
  {
    "measurement": "cloud_billing",
    "tags": {
      "billing_id"  : "anvxfafakjflxxxxxxx",
      "account_id"  : "100025xxxxxx113474",
      "account_name": "100025xxxxxx113474",
      "billing_date": "2022-09-12",
      "product_code": "mongodb",
      "product_name": "Cloud Database TencentDB for MongoDB"
    },
    "fields": {
      "amount"        : 0.7,
      "offical_amount": 0.7
    },
    "timestamp": 1657507837
  }
]

4. Synergy with Custom Object Collectors

When other custom object collectors (such as CVM) are running in the same DataFlux Func, this collector supplements fields based on the dimensional information described in the data collection instructions. For example, CVM attempts to match the name field in custom objects based on the ResourceId field returned by the bill. If a successful match occurs, all fields except name in the matched custom object tags are added to the tags of the billing data. The specific effect is as follows:

Assuming the original computed billing data is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  {
    "measurement": "cloud_billing",
    "tags": {
      "billing_id"  : "anvxfafakjflxxxxxxx",
      "instance_id" : "cmgo-xxxx",
      "product_code": "mongodb",
      "product_name": "Cloud Database TencentDB for MongoDB",
      "account_id"  : "100025xxxxxx113474",
      "account_name": "100025xxxxxx113474"
    },
    "fields": {
      "amount"        : 13.25492784,
      "offical_amount": 13.25492784
    },
    "timestamp": 1662940800
  }

The data collected by the custom object collector is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  {
    "measurement": "tencentcloud_mongodb",
    "tags": {
      "RegionId"   : "cn-nanjing",
      "instance_id": "cmgo-xxxxx",
      "{Other Fields}": "{Omitted}"

    },
    "fields": {
      "{Other Fields}": "{Omitted}"
    }
  }

Thus, the final reported billing 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
  {
    "measurement": "cloud_billing",
    "tags": {
      "billing_id"  : "anvxfafakjflxxxxxxx",
      "instance_id"         : "cmgo-x",
      "region_id"            : "cn-nanjing",
      "product_code": "mongodb",
      "product_name": "Cloud Database TencentDB for MongoDB",
      "account_id"  : "100025xxxxxx113474",
      "account_name": "100025xxxxxx113474",
      "cloud_provider"      : "tencentcloud",
      "{Other Fields}"      : "{Omitted}"

    },
    "fields": {
      "amount"        : 13.25492784,
      "offical_amount": 13.25492784,
      "{Other Fields}"            : "{Omitted}"
    },
    "timestamp": 1662940800
  }

X. Appendix

Tencent Cloud - Billing Management 「Query Bill Detail Data」

Please refer to the official Tencent Cloud documentation: