Billing Logic¶
This article demonstrates the billing generation and price calculation logic for each billing item under the pay-as-you-go billing framework of the TrueWatch product.
Concepts¶
Term | Description |
---|---|
Data Storage | Customize the data retention period for different data types. |
Basic Billing | The unit price of a billing item is a fixed value. |
Tiered Billing | The unit price of a billing item is a dynamic value, which varies based on the data storage strategy selected for the current data type. |
Billing Cycle¶
The billing cycle for TrueWatch is daily. The usage statistics for the workspace on the current day are settled at midnight the next day, generating a daily bill that is synchronized to the TrueWatch Billing Center. The actual consumption amount is then deducted from the corresponding account based on the bound settlement method.
Billing Items¶
Time Series¶
The time series engine storage in TrueWatch involves the following basic concepts:
Term | Description |
---|---|
Measurement | Generally represents a collection of statistical values, conceptually similar to a table in a relational database. |
Data Point | In the context of metric data reporting, it refers to a single sample of metric data, analogous to a row in a relational database. |
Time | Timestamp, representing the time when the data point was generated, which can also be understood as the time when DataKit collected and reported the metric data in line protocol. |
Metric | Field, generally stores numerical data that changes with the timestamp. For example, common metrics in the CPU measurement include cpu_total , cpu_use , cpu_use_pencent , etc. |
Tag | Tags, generally store attribute information that does not change with the timestamp. For example, common tag fields in the CPU measurement include host , project , etc., which identify the actual object attributes of the metric. |
Example¶
In the example above, the CPU measurement contains 6 data points based on a single metric. Each data point has a time field: time
, a metric: cpu_use_pencent
, and two tags: host
, project
. The first and fourth rows of data represent the CPU usage (cpu_use_pencent
) for the host
named Hangzhou_test1
and the project
belonging to TrueWatch. Similarly, the second and fifth rows represent the CPU usage for the host
named Ningxia_test1
and the project
belonging to TrueWatch. The third and sixth rows represent the CPU usage for the host
named Singapore_test1
and the project
belonging to TrueWatch_oversea
.
Based on the time series statistics above, there are 3 combinations of time series for the cpu_use_pencent
metric:
"host":"Hangzhou_test1","project":"TrueWatch"
"host":"Ningxia_test1","project":"TrueWatch"
"host":"Singapore_test1","project":"TrueWatch_oversea"
Similarly, to count all the time series for metrics in the current workspace, simply sum the actual counted time series for the metrics.
Data collected by DataKit and reported to a workspace. Specifically refers to data queried with the NameSpace M in DQL.
Billing Item Statistics
The number of new time series within the day is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/1000 * Unit price (apply the corresponding unit price based on the data storage strategy above)
Logs¶
The following scenarios will generate corresponding log data:
-
Enable log data collection and reporting;
-
Enable monitor, intelligent inspection, SLO, and other anomaly detection tasks or report custom events via OpenAPI;
-
Enable synthetic testing tasks and trigger reporting of test data through self-built test nodes.
Billing Item Statistics
The number of new log data within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/1000000 * Unit price (apply the corresponding unit price based on the data storage strategy above)
Warning
Depending on the selected storage type, oversized log data will be split into multiple entries for billing:
ES Storage: If the log size exceeds 10 KB, the number of billing entries = Round up (log size/10 KB)
SLS Storage: If the log size exceeds 2 KB, the number of billing entries = Round up (log size/2 KB)
If a single piece of data is smaller than the above limit, it is still counted as 1 entry.
Data Forwarding¶
Supports forwarding log data to TrueWatch or four other external storage methods. Based on data forwarding rules, the total forwarded traffic size is counted for billing.
Note: Data forwarded to TrueWatch is still retained.
Billing Item Statistics
The size of data forwarded within the data storage strategy is counted at hourly intervals. Default unit: Bytes.
Cost calculation formula: Daily cost = Actual billing size/1000000000 * Corresponding unit price
Network¶
- Enable eBPF network data collection
Billing Item Statistics
The number of new hosts within the day is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count * Corresponding unit price
APM Trace¶
- Daily Span data count generated within the workspace.
Note: In the new billing adjustment of TrueWatch, the larger value between "count/10" and trace_id
count will be used as the daily billing data.
Billing Item Statistics
The number of new trace_id
within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/1000000 * Corresponding unit price
APM Profile¶
- Enable APM Profile data collection
Billing Item Statistics
The number of new Profile data within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/10000 * Corresponding unit price
Warning
Profile data mainly consists of two parts: Basic attribute data + Profile analysis file:
If there is an oversized Profile analysis file, the Profile data will be split into multiple entries for billing.
If the Profile analysis file data exceeds 300 KB, the number of billing entries = Round up (Profile analysis file size/300 KB)
If the analysis file is smaller than the above limit, it is still counted as 1 entry.
RUM PV¶
- Daily Resource, Long Task, Error, Action data count generated within the workspace.
Note: In the new billing adjustment of TrueWatch, the larger value between "count/100" and PV count will be used as the daily billing data.
Billing Item Statistics
The number of new PV data within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/10000 * Unit price (apply the corresponding unit price based on the data storage strategy above)
Session Replay¶
- Enable session replay collection
Billing Item Statistics
The number of new Sessions within the day is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/1000 * Corresponding unit price
Warning
If there is an overly long active Session, the Session will be split into multiple entries based on time_spent
for billing.
If Session time_spent
> 4 hours, the number of billing entries = Round up (time_spent
/4 hours);
If Session time_spent
is less than the above 4 hours, it is still counted as 1 Session.
Synthetic Tests¶
- Enable synthetic testing tasks and return test results through TrueWatch provided test nodes
Billing Item Statistics
The number of new test data within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/10000 * Corresponding unit price
Warning
Since the test data is currently stored in the default index of logs, additional filter conditions are required for DQL queries or statistics to retrieve test data.
index = ['default'], source = [‘http_dial_testing',‘tcp_dial_testing’,'icmp_dial_testing','websocket_dial_testing']
.
Triggers¶
-
Enable monitor, SLO, and other scheduled detection tasks. For monitor mutation detection, range detection, outlier detection, and log detection, each detection counts as 5 triggers. Other detection types count as 1 trigger. Additionally, if the detection interval exceeds 15 minutes, the excess part counts as 1 trigger per 15 minutes;
-
Intelligent monitoring: Host, log, and application intelligent detection each count as 10 triggers per execution; RUM intelligent detection counts as 100 triggers per execution.
Calculation Example
Monitor Trigger Count:
- Normal scenario calculation example: If one [Mutation Detection] is executed, it counts as 5 triggers.
- Calculation example for exceeding the detection interval: If the detection interval is 30 minutes, the excess part counts as 1 trigger per 15 minutes. For example, executing one [Outlier Detection] counts as 6 triggers.
- Calculation example for multiple detection types and exceeding the detection interval: Executing two [Range Detections] with a total detection interval of 60 minutes counts as 13 triggers (2 detections * 5 + 3 excess detection intervals).
Intelligent Monitoring Trigger Count Calculation Example: If one [Host Intelligent Monitoring] is executed, it counts as 10 triggers.
- Each DataKit/OpenAPI query counts as 1 trigger;
- Each metric generation query counts as 1 trigger;
- Each query using the advanced functions provided by the central Func counts as 1 trigger.
Billing Item Statistics
The number of new triggers within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/10000 * Corresponding unit price
SMS¶
- Configure SMS notifications in alert strategies
Billing Item Statistics
The number of new SMS sends within 1 hour is counted at hourly intervals.
Cost calculation formula: Daily cost = Actual billing count/10 * Unit price
Billing Example¶
Assume Company A uses TrueWatch to monitor its IT infrastructure, application systems, etc.
Assume Company A has a total of 10 hosts (each host has a default daily active time series of 600), generating 6000 time series, 2 million log entries, 2 million Trace entries, 20,000 PV entries, and 20,000 trigger executions daily. The data storage strategies used are as follows:
Billing Item | Metrics (Time Series) | Logs | APM Trace | RUM PV |
---|---|---|---|---|
Data Storage Strategy | 3 days | 7 days | 3 days | 3 days |
The details are as follows:
Billing Item | Daily Billing Count | Unit Price | Billing Logic | Daily Billing Cost |
---|---|---|---|---|
Time Series | 6000 | 0.6 CNY/1000 | (Actual billing count/1000) * Unit price i.e., (6000/1000) * 0.6 CNY |
3.6 CNY |
Logs | 2 million | 1.2 CNY/million | (Actual billing count/billing unit) * Unit price i.e., (2 million/1 million) * 1.2 CNY |
2.4 CNY |
Trace | 2 million | 2 CNY/million | (Actual billing count/billing unit) * Unit price i.e., (2 million/1 million) * 2 CNY |
4 CNY |
PV | 20,000 | 0.7 CNY/10,000 | (Actual billing count/billing unit) * Unit price i.e., (20,000/10,000) * 0.7 CNY |
1.4 CNY |
Triggers | 20,000 | 1 CNY/10,000 | (Actual billing count/billing unit) * Unit price i.e., (20,000/10,000) * 1 CNY |
2 CNY |
Note: Since time series is an incremental billing item, changes in the number of time series generated by the company will affect the cost.
For more time series count calculations, refer to Time Series Example.