Skip to content

Collector Configuration Manual for "Huawei Cloud - DCS Slow Log Statistics Collector"

Before reading this article, please first read:

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

This script's code execution depends on DCS instance object collection. If custom object collection for DCS is not configured, the slow log script will not be able to collect slow log data.

1. Configuration Structure

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 a complete list

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

Configuration Two (Legacy Compatibility)

The configuration structure for this collector is as follows:

Field Type Required Description
region_projects dict Required List of "Region - Project ID" pairs to collect data from
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 collect data from within that region
Refer to the appendix for a complete list

2. Configuration Example

Specify Region

Collect DCS slow log data for projects in the cn-north-4 region.

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

3. Data Reporting Format

After the data synchronizes successfully, it can be viewed in the "LOGs" section of <<< brand_name >>>.

An example of reported data is shown below:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
    "measurement": "huaweicloud_dcs_slowlog",
    "tags": {
      "RegionId"             : "cn-north-4",
      "project_id"           : "c631f04625xxxxxxxxxxf253c62d48585",
      "enterprise_project_id": "0",
      "name"                 : "71be0037-x-x-x-b6b91f134066",
      "instance_id"          : "71be0037-x-x-x-b6b91f134066",
      "instance_name"        : "dcs-iash",
      "engine"               : "Redis",
      "id"                   : "674",
      "command"              : "INFO all",
      "shard_name"           : "group-0"
    },
    "fields": {
      "duration"             : "62",
      "start_time"           : "2022-07-21T10:40:02Z",
      "message"              : "{Instance JSON data}"
    }
}
Descriptions of some parameters are as follows:

Field Type Description
duration str Execution time

4. Precautions

Fields in tags and fields may change with subsequent updates.

fields.message is a string after JSON serialization.

X. Appendix

HuaweiCloud-DCS "Regions"

Please refer to the official HuaweiCloud documentation:

HuaweiCloud-DCS "Slow Log Information Documentation"

Please refer to the official HuaweiCloud documentation: