# Log Service Billing

This document describes the **postpaid** billing items and pricing for Log Service.

## Billing Cycle

Log Service uses a **daily settlement** postpaid model. The system calculates the previous day's resource usage and generates a bill in the early morning of each day. Billing starts at 00:00:00 on May 7, 2026, with the first bill generated in the early morning of May 8, 2026. The billing period covers 00:00:00 to 23:59:59 on May 7, 2026. Resources used before this time incur no charges.

## Pricing
| Category     | Billable Item    | Unit Price  |
| ------  | --------- | ----------- |
| Traffic | Write Traffic | $0.0283 /GB |
| Traffic | Standard Index Traffic | $0.0644 /GB |
| Storage | Standard Log Storage | $0.0026 /GB·Day |
| Storage | Standard Index Storage | $0.0026 /GB·Day |
| Partition | Topic Partition | $0.0063 /Partition·Day |

## Billable Item Details

### Traffic

| Billable Item | Description | Billing Formula |
| ------------ | ---------------- | ----------------- |
| Write Traffic | Write traffic charges are incurred when uploading logs to a target log topic, billed based on the amount of data received by Log Service. | Write Traffic Fee = Unit Price per GB × Daily Cumulative Write Traffic |
| Standard Index Traffic | Index traffic charges are incurred during the process of generating standard indexes for logs, billed based on the amount of data generated when Log Service builds indexes. **Note**: Index traffic is only generated after indexing is enabled. | Standard Index Traffic Fee = Unit Price per GB × Daily Cumulative Standard Index Traffic |

### Storage

| Billable Item | Description | Billing Formula |
| ------------ | ---------------- | ----------------- |
| Standard Log Storage | Billed based on the storage space occupied by log data. | Standard Log Storage Fee = Unit Price per GB × Daily Average Standard Log Storage |
| Standard Index Storage | Billed based on the storage space occupied by log index data. | Standard Index Storage Fee = Unit Price per GB × Daily Average Standard Index Storage |

> Storage calculation method: The system collects storage data once per minute, totaling 1,440 collections per day. The daily storage amount is the arithmetic average of all collected values.

### Other Charges

| Billable Item | Description | Billing Formula |
| ------------ | ---------------- | ----------------- |
| Topic Partition | Billed based on the number of topic partitions occupied. | Topic Partition Fee = Unit Price × Daily Cumulative Topic Partition Count |

## Billing Example

Assume a user uses Log Service in an overseas region with the following monthly usage:

- Monthly log write volume: 100 GB (raw data)
- Log retention period: 30 days (indexing enabled)
- Number of topic partitions: 2
- Compression ratio: 8:1 (write traffic and log storage calculated at 1/8 of raw data)
- Billing precision: amounts less than 1 GB are rounded up to 1 GB

The monthly cost is calculated as follows:

| Billable Item           | Formula                        | Cost (USD/Month) |
| ---------------- | ------------------------------- | ------------- |
| Write Traffic       | 0.0283 × 13                       | 0.37          |
| Standard Index Traffic | 0.0644 × 100                      | 6.44         |
| Standard Log Storage | 0.0026 × 13 × 30                | 1.01         |
| Standard Index Storage | 0.0026 × 100 × 30               | 7.80         |
| Topic Partition     | 0.0063 × 2 × 30                   | 0.38          |
| **Total**         | -                               | **16.00**   |

> The above prices are for reference only. Actual charges are subject to the console bill.
