Configuration Manual for the "Huawei Cloud - RDS Slow Log Details Collector"
Before reading this, please refer to:
Before using this collector, you must install the 'Integration Core Package' and its associated third-party dependency packages
This script's code execution depends on RDS instance object collection. If RDS custom object collection is not configured, the slow log script will not be able to collect slow log data.
1. Configuration Structure
The configuration structure of this collector is as follows:
Configuration One (Recommended)
Field | Type | Required | Description |
---|---|---|---|
regions |
list | Required | List of regions to be collected |
regions[#] |
str | Required | Region ID. For example: 'cn-north-4' See appendix for full list |
The collector will automatically retrieve all IAM projects under the region and then obtain resources based on IAM projects
Configuration Two (Legacy Compatibility)
Field | Type | Required | Description |
---|---|---|---|
region_projects |
dict | Required | List of 'Region - Project ID' pairs to be collected |
region_projects[#] |
str:list | Required | Key-value pairs where: Key represents the region (for example: 'cn-north-4' )Value represents the list of project IDs to be collected under that region See appendix for full list |
2. Configuration Example
Specifying a Region
Collect RDS slow log data for projects in the cn-north-4
region.
Python | |
---|---|
1 2 3 |
|
3. Data Reporting Format
After data synchronization, it can be viewed in the 'LOG' section of TrueWatch.
Example of reported data:
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 |
|
Partial parameter descriptions are as follows:
Field | Type | Description |
---|---|---|
count |
str | Number of SQL executions. |
execution_time |
str | Execution time. |
start_time |
str | Execution timestamp (UTC). |
lock_time |
str | Lock wait time (only supported by MySQL). |
rows_sent |
integer | Result count statistics (only supported by MySQL). |
rows_examined |
integer | Number of rows scanned (only supported by MySQL). |
4. Precautions
Fields in tags and fields may change with subsequent updates
fields.message is a JSON serialized string
5. Troubleshooting
When running the program, the following errors may occur:
Text Only | |
---|---|
1 2 |
|
The error message will print details about the corresponding instance, such as:
Text Only | |
---|---|
1 |
|
Reason: The slow log data for a specific RDS instance was requested, but the instance has already been released, causing the API to throw an error.
Solution: Ignore the error.
X. Appendix
HuaweiCloud-RDS "Regions"
Refer to the official HuaweiCloud documentation:
HuaweiCloud-RDS "Slow Log Information Documentation"
Refer to the official HuaweiCloud documentation: