Skip to content

Collector Configuration Manual for "Huawei Cloud - DDS"

Before reading this article, please read the following first:

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

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. Example: 'cn-north-4'
Refer to appendix for full list

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

Configuration Two (Legacy Compatibility)

Field Type Required Description
region_projects dict Required List of 'Region - Project ID' pairs 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 in that region
Refer to appendix for full list

2. Configuration Examples

Specify Region

Collect data from DDS instances in the cn-north-4 region.

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

Configure Filters (Optional)

This collector script supports user-defined filters, allowing users to filter target resources by object properties. The filter function returns True or False. - True: Target resource needs to be collected. - False: Target resource does not need to be collected.

Supported object properties:

Property Description
id Instance ID
name Instance Name
db_user_name Username
engine Storage Engine
mode Instance Type
pay_mode Billing Method
port Database Port
status Instance Status
vpc_id VPC ID
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Example: Enable the filter, filter objects by location and name attributes, configuration format as follows:

def filter_instance(instance):
    instance_id = instance['id']
    if instance_id in ['xxx']:
        return True
    return False

###### Do not modify the following contents #####
from guance_integration__runner import Runner
import guance_huaweicloud_dds__main as main

def run():
    Runner(main.DataCollector(account, collector_configs, filters=[filter_instance])).run()

3. Data Reporting Format

After data synchronization, it can be viewed in the {{( brand_name )}} "Infrastructure - Resource Catalog".

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
28
{
  "measurement": "huaweicloud_dds",
  "tags": {
    "RegionId"             : "cn-north-4",
    "project_id"           : "c631f046252d4ebdaxxxx",
    "enterprise_project_id": "0",
    "name"                 : "2afe1b3ce2xxxxxx",
    "instance_id"          : "2afe1b3ce2xxxxxx",
    "instance_name"        : "dds-xxxx",
    "status"               : "normal"
  },
  "fields": {
    "db_user_name"     : "rwuser",
    "engine"               : "wiredTiger",
    "mode"                 : "Single",
    "pay_mode"             : "0",
    "port"                 : "8635",
    "security_group_id"    : "d13ebb59-d4fe-43a5-9832-xxxx",
    "ssl"                  : "0",
    "vpc_id"               : "f6bc2c55-2a95-40ce-835b-xxxx",
    "backup_strategy"      : "{Backup Strategy}",
    "created"              : "2022-08-01T10:07:41",
    "datastore"            : "{Database Information}",
    "groups"               : "[{Group Information}]",
    "updated"              : "2022-08-01T10:07:40",
    "message"              : "{Instance JSON Data}"
  }
}

Explanation of some fields:

Field Type Description
enterprise_project_id String Enterprise project ID.
If value is "0", it indicates the default enterprise project.
engine String Storage engine. Supports WiredTiger/RocksDB storage engines.
When database version is 4.2, storage engine is RocksDB, value is "rocksDB".
When database version is 4.0 and 3.4, storage engine is WiredTiger, value is "wiredTiger".
mode String Instance type.
Value "Sharding" indicates cluster instance.
Value "ReplicaSet" indicates replica set instance.
Value "Single" indicates single node instance.
pay_mode String Billing method.
Value "0" indicates pay-as-you-go billing.
Value "1" indicates annual/monthly billing.
ssl Integer Whether SSL secure connection is enabled.
Value "1" indicates enabled.
Value "0" indicates disabled.
status String Instance status.
Possible values:
normal, indicating instance is normal.
abnormal, indicating instance has issues.
creating, indicating instance is being created.
frozen, indicating instance is frozen.
data_disk_full, indicating storage space is full.
createfail, indicating instance creation failed.
enlargefail, indicating instance node expansion failed.

Fields in tags and fields may change with subsequent updates.

tags.name value is the instance ID, used as a unique identifier.

The following fields are serialized JSON strings.

  • fields.messages
  • fields.backup_strategy
  • fields.datastore
  • fields.groups

Specific field meanings inside fields.backup_strategy, fields.datastore, fields.groups can be found in the appendices related to querying instance lists and details API documentation.

X. Appendix

Huawei Cloud DDS "Region ID"

Refer to the official Huawei Cloud documentation: