Skip to content

Configuration Manual for the "Huawei Cloud-RabbitMQ" Collector

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 for 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 full list

The collector will automatically fetch all IAM projects under the region and then retrieve resources based on 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 In key-value pairs:
Key represents the region (e.g., 'cn-north-4')
Value represents the list of project IDs to be collected within that region
Refer to the appendix for the full list

2. Configuration Example

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

Configuration Filters (Optional)

This collector script supports user-defined filters, allowing users to filter target resources via object properties. The filter function returns True|False.

  • True: Target resource needs to be collected.
  • False: Target resource does not need to be collected.

Supported object properties for filtering:

Property Description
instance_id Instance ID
engine Instance Engine
connect_address Instance Connection IP Address
status Instance Status
port Port
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def filter_instance(instance):
    '''
    Collect instances with an instance ID of xxxx
    '''
    instance_id = instance.get('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_rabbitmq__main as rabbitmq_main
import guance_huaweicloud_ces__main as ces_main


@DFF.API('HuaweiCloud RabbitMQ Collection', timeout=3600, fixed_crontab='* * * * *')
def run():
    collectors = [
        rabbitmq_main.DataCollector(account, collector_configs, filter_instance=filter_instance),
    ]
    Runner(collectors).run()

3. Data Reporting Format

After data synchronization, you can view the data in the 'Infrastructure-Resource Catalog' section of {{( brand_name )}}.

An example of 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
26
27
28
29
30
31
32
33
34
{
  "measurement": "huaweicloud_rabbitmq",
  "tags": {
    "RegionId"                  : "cn-north-4",
    "project_id"                : "xxxx",
    "enterprise_project_id"     : "0",
    "name"                      : "f127cbb0-xxxx-xxxx-xxxx-aed5a36da5d9",
    "instance_id"               : "f127cbb0-xxxx-xxxx-xxxx-aed5a36da5d9",
    "instance_name"             : "rabbitmq-xxxx",
    "engine"                    : "rabbitmq",
    "status"                    : "RUNNING"
  },
  "fields": {
    "charging_mode"             : "1",
    "connect_address"           : "192.xxx.0.xxx",
    "engine_version"            : "3.8.35",
    "port"                      : "xxxx",
    "access_user"               : "rabbit_mh",
    "available_zones"           : "[Instance JSON Data]",
    "connect_address"           : "192.xxx.0.xxx",
    "created_at"                : "1687143955266",
    "description"               : "",
    "enable_publicip"           : false,
    "maintain_begin"            : "02:00:00",
    "maintain_end"              : "06:00:00",
    "management_connect_address": "http://192.xxx.0.xxx:15672",
    "resource_spec_code"        : "",
    "specification"             : "rabbitmq.2u4g.single * 1 broker",
    "storage_space"             : 83,
    "total_storage_space"       : 100,
    "used_storage_space"        : 0,
    "message"                   : "{Instance JSON Data}"
  }
}

Descriptions of some fields are as follows:

Field Type Description
specification String Instance specification.
RabbitMQ single-instance returns vm specification.
RabbitMQ cluster instance returns vm specification and number of nodes.
charging_mode String Billing mode, 1 indicates pay-as-you-go billing, 0 indicates annual/monthly subscription billing.
available_zones String Available zones where the instance nodes are located, returns "Available Zone ID".
maintain_begin String Start time of maintenance window, format is HH:mm:ss
maintain_end String End time of maintenance window, format is HH:mm:ss
created_at String Completion creation time. Timestamp format, indicating the total milliseconds deviation from Greenwich Mean Time January 1, 1970 00:00:00 to the specified time.
resource_spec_code String Resource specification identifier
dms.instance.rabbitmq.single.c3.2u4g:RabbitMQ single instance, vm specification 2u4g
dms.instance.rabbitmq.single.c3.4u8g:RabbitMQ single instance, vm specification 4u8g
dms.instance.rabbitmq.single.c3.8u16g:RabbitMQ single instance, vm specification 8u16g
dms.instance.rabbitmq.single.c3.16u32g:RabbitMQ single instance, vm specification 16u32g
dms.instance.rabbitmq.cluster.c3.4u8g.3:RabbitMQ cluster, vm specification 4u8g, 3 nodes
dms.instance.rabbitmq.cluster.c3.4u8g.5:RabbitMQ cluster, vm specification 4u8g, 5 nodes
dms.instance.rabbitmq.cluster.c3.4u8g.7:RabbitMQ cluster, vm specification 4u8g, 7 nodes
dms.instance.rabbitmq.cluster.c3.8u16g.3:RabbitMQ cluster, vm specification 8u16g, 3 nodes
dms.instance.rabbitmq.cluster.c3.8u16g.5:RabbitMQ cluster, vm specification 8u16g, 5 nodes
dms.instance.rabbitmq.cluster.c3.8u16g.7:RabbitMQ cluster, vm specification 8u16g, 7 nodes
dms.instance.rabbitmq.cluster.c3.16u32g.3:RabbitMQ cluster, vm specification 16u32g, 3 nodes
dms.instance.rabbitmq.cluster.c3.16u32g.5:RabbitMQ cluster, vm specification 16u32g, 5 nodes
dms.instance.rabbitmq.cluster.c3.16u32g.7:RabbitMQ cluster, vm specification 16u32g, 7 nodes

Fields in tags and fields may change with subsequent updates

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

fields.message and fields.available_zones are serialized JSON strings

X. Appendix

Please refer to the official Huawei Cloud documentation: