Skip to content

Collector Configuration Manual for "Volcengine-MySQL Slow Log Collection"

Before reading this, please refer to the following:

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

This script's code execution depends on the collection of Volcengine MySQL instance objects. If not configured, slow log data cannot be collected.

1. Configuration Structure

The configuration structure of this collector is as follows:

Field Type Required Description
regions list Optional List of regions to collect data from
regions[#] str Optional Region ID. For example: 'cn-beijing'
Refer to the appendix for the complete list

2. Configuration Example

Specifying Regions

Collecting data from the Beijing region

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

3. Data Reporting Format

After the 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
{
  "measurement": "volcengine_mysql_slowlog",
  "tags": {
    "ConnectionId": "122695",
    "DB": "-",
    "InstanceId": "mysql-xxx",
    "InstanceName": "test",
    "InstanceStatus": "Running",
    "ProjectName": "default",
    "RegionId": "cn-beijing",
    "SourceIP": "xx.xxx.x.xxx",
    "User": "admin",
    "ZoneId": "cn-beijing-a"
  },
  "fields": {
    "LockTime": 0,
    "QueryTime": 3.000151,
    "RowsExamined": 1,
    "RowsSent": 1,
    "SQLTemplate": "SELECT SLEEP(?)",
    "SQLText": "SELECT SLEEP(3)",
    "Timestamp": 1737027635,
    "message": "{JSON log data}"
  },
  "timestamp": 1737027635
}

Fields in tags and fields may change with subsequent updates

The following fields are JSON serialized strings

  • fields.message

X. Appendix

Please refer to the official Volcengine documentation: