Skip to content

Configuration Manual for the "Tencent Cloud - Redis" Collector

Before reading this article, please read the following first:

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 to collect data from
regions[#] str Required Region ID. For example: 'ap-shanghai'
See the full table in the appendix

2. Configuration Example

Specifying a Region

Collecting data from the Shanghai region

Python
1
2
3
collector_configs = {
    'regions': [ 'ap-shanghai' ]
}

Configuring 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:

Property Description
InstanceId Instance ID
InstanceName Instance Name
BillingMode Billing Mode
Engine Engine
Port Instance Port
ProductType Product Type
ProjectId Project ID
Status Current Instance Status
Type Instance Type
WanIp Instance VIP
ZoneId Zone ID
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Example: Enable filters based on the InstanceId and ProductType properties of an object; configuration format is as follows:

def filter_instance(instance):
    '''
    return True|False
    '''
    instance_id = instance['InstanceId']
    product_type = instance['ProductType']
    if instance_id in ['xxx'] and product_type in ['cluster']:
        return True
    return False

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

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

3. Data Reporting Format

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

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
26
27
{
  "measurement": "tencentcloud_redis",
  "tags": {
    "name"        : "crs-xxxx",
    "BillingMode" : "0",
    "Engine"      : "Redis",
    "InstanceId"  : "crs-xxxy",
    "InstanceName": "solution",
    "Port"        : "6379",
    "ProductType" : "standalone",
    "ProjectId"   : "0",
    "RegionId"    : "ap-shanghai",
    "Status"      : "2",
    "Type"        : "6",
    "WanIp"       : "172.x.x.x",
    "ZoneId"      : "200002"
  },
  "fields": {
    "ClientLimits"    : "10000",
    "Createtime"      : "2022-07-14 13:54:14",
    "DeadlineTime"    : "0000-00-00 00:00:00",
    "InstanceNodeInfo": "{instance node information}",
    "InstanceTitle"   : "running",
    "Size"            : 1024,
    "message"         : "{instance JSON data}"
  }
}

Descriptions of some fields are as follows, detailed information can be found in the appendix interface return parameters:

Field Type Description
Size Float Instance capacity size, unit: MB
BillingMode Integer Billing mode: 0 - pay-as-you-go, 1 - prepaid
Engine String Engine: Community Edition Redis, Tencent Cloud CKV
ProductType String Product type: standalone – Standard Edition, cluster – Cluster Edition
Status Integer Current status of the instance
0: Pending Initialization
1: Instance In Process
2: Instance Running
-2: Instance Isolated
-3: Instance Pending Deletion
Type Integer Instance type:
1 – Redis2.8 Memory Edition (Cluster Architecture)
2 – Redis2.8 Memory Edition (Standard Architecture)
3 – CKV 3.2 Memory Edition (Standard Architecture)
4 – CKV 3.2 Memory Edition (Cluster Architecture)
5 – Redis2.8 Memory Edition (Single Machine)
6 – Redis4.0 Memory Edition (Standard Architecture)
7 – Redis4.0 Memory Edition (Cluster Architecture)
8 – Redis5.0 Memory Edition (Standard Architecture)
9 – Redis5.0 Memory Edition (Cluster Architecture)
InstanceNodeInfo Array Instance node information

Fields in tags and fields may change with subsequent updates

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

fields.message and fields.InstanceNode are strings after JSON serialization

X. Appendix

Please refer to the official Tencent Cloud documentation: