Skip to content

Configuration Manual for the "Huawei Cloud-OBS" Collector

Before reading this article, please first read:

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

1. Configuration Structure

The configuration structure of this collector is as follows:

Field Type Required Description
regions list Required List of regions for which data needs to be collected
regions[#] str Required Region ID. For example: 'cn-north-4'
See the full table in the appendix

2. Configuration Example

Specify Region

Collect data from OBS instances corresponding to the North China - Beijing Four 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 based on object properties. The filter function returns True or False: - True: The target resource should be collected. - False: The target resource should not be collected.

Supported object properties for filtering:

Property Description
name Bucket name
es_version Bucket type
location Region
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Example: Enable filters, filter by the location and name properties of the object, with the following configuration format:

def filter_bucket(bucket):
    '''
    return True|False
    '''
    bucket_location = bucket['location']
    bucket_name = bucket['name']
    if bucket_location in ['cn-north-4'] and bucket_name in ['xxx']:
        return True
    return False

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

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

3. Data Reporting Format

After data is synchronized successfully, it can be viewed in the {{( brand_name )}}'s "Infrastructure - Resource Catalog".

An example of reported data is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "measurement": "huaweicloud_obs",
  "tags": {
    "name"       : "test0-6153",
    "RegionId"   : "cn-north-4",
    "bucket_type": "OBJECT",
    "location"   : "cn-north-4"
  },
  "fields": {
    "create_date": "2022/06/16 10:51:16",
    "message"    : "{JSON instance data}"
  }
}

Descriptions of some parameters are as follows:

Meanings of bucket_type (bucket type) values:

Value Description
OBJECT Object storage bucket
POSIX Parallel file system

Fields in tags and fields may change with subsequent updates

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

X. Appendix

Huawei Cloud OBS "Region ID"

Please refer to the official Huawei Cloud documentation: