Skip to content

Configuration Manual for the "Huawei Cloud - DDS Slow Log Statistics Collector"

Before reading this, please refer to:

Before using this collector, you must install the 'Integration Core Package' and its corresponding third-party dependency packages

The code execution of this script depends on DDS instance object collection. If custom object collection for DDS 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 collect data from
regions[#] str Required Region ID. For example: 'cn-north-4'
Refer to the appendix for the complete list

The collector will automatically fetch all IAM projects under the region and then obtain resources based on these IAM projects.

Configuration Two (Legacy Compatibility)

Field Type Required Description
region_projects dict Required List of 'Region - Project ID' pairs required for data collection
region_projects[#] str:list Required Key-value pairs where:
Key represents the region (e.g., 'cn-north-4')
Value represents the list of project IDs to be collected under that region
Refer to the appendix for the complete list

2. Configuration Example

Specifying a Region

Collecting DDS slow log data for the cn-north-4 region.

Python
1
2
3
collector_configs = {
    'regions': ['cn-north-4']
}

3. Data Reporting Format

After data synchronization, you can view the data in the 'LOG' section of TrueWatch.

An example of the 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
21
22
23
24
25
{
    "measurement": "huaweicloud_dcs_slowlog",
    "tags": {
      "RegionId"             : "cn-north-4",
      "project_id"           : "c631f046252d4ebdaxxxx",
      "enterprise_project_id": "0",
      "name"                 : "2afe1b3ce2xxxxxx",
      "instance_id"          : "2afe1b3ce2xxxxxx",
      "instance_name"        : "dds-xxxx",
      "status"               : "normal",
      "node_name"            : "dds-xxxxxxx",
      "query_sample"         : "{JSON syntax execution data}",
      "database"             : "test_db",
      "type"                 : "INSERT"
    },
    "fields": {
      "time"                 : "17 ms",
      "start_time"           : "2022-09-05T03:48:33.335000Z",
      "lock_time"            : "0 us",
      "rows_examined"        : "0",
      "rows_sent"            : "0",
      "start_time"           : "2022-07-21T10:40:02Z",
      "message"              : "{Instance JSON data}"
    }
}
Explanation of some parameters:

Field Type Description
time str Execution time

4. Precautions

Fields in tags and fields may change with subsequent updates.

fields.message and tags.query_sample are serialized JSON strings.

X. Appendix

HuaweiCloud-DDS "Regions"

Please refer to the official HuaweiCloud documentation:

HuaweiCloud-DDS "Slow Log Information Documentation"

Please refer to the official HuaweiCloud documentation: