Tencent Cloud Redis¶
Tencent Cloud Redis Metrics Display, including connections, requests, latency, slow queries, etc.
Configuration¶
Install Func¶
It is recommended to activate TrueWatch Integration - Extensions - DataFlux Func (Automata): All prerequisites are automatically installed, please proceed with the script installation.
If you want to deploy Func manually, refer to Manual Func Deployment
Install Script¶
Note: Please prepare Tencent Cloud AK with the required permissions in advance (for simplicity, you can grant global read-only permissions
ReadOnlyAccess
)
To synchronize monitoring data for Tencent Cloud-Redis, we install the corresponding collection script: 「TrueWatch Integration (Tencent Cloud-Redis Collection)」(ID: integration_tencentcloud_redis
)
After clicking 【Install】, enter the relevant parameters: Tencent Cloud AK, Tencent Cloud account name.
Click 【Deploy Startup Script】, and the system will automatically create the Startup
script set and configure the corresponding startup scripts.
Additionally, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute it once without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
Verification¶
- In 「Management / Automatic Trigger Configuration」, confirm whether the corresponding task has the automatic trigger configuration, and check the task records and logs for any exceptions.
- In TrueWatch, check if asset information exists in 「Infrastructure / Custom」.
- In TrueWatch, check if the corresponding monitoring data is available in 「Metrics」.
Metrics¶
After configuring Tencent Cloud-Redis, the default Measurement is as follows. You can collect more metrics through configuration Tencent Cloud Cloud Monitoring Metrics Details
Redis Instance Monitoring¶
Metric Name | Metric Description | Metric Explanation | Unit | Dimensions | Statistical Granularity |
---|---|---|---|---|---|
CpuUtil |
CPU Utilization | Average CPU Utilization | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CpuMaxUtil |
Node Maximum CPU Utilization | Maximum CPU Utilization among nodes (shards or replicas) in the instance | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
MemUsed |
Memory Usage | Actual memory usage, including data and cache parts | MB | instanceid |
5s, 60s, 300s, 3600s, 86400s |
MemUtil |
Memory Utilization | Ratio of actual memory usage to total requested memory | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
MemMaxUtil |
Node Maximum Memory Utilization | Maximum memory utilization among nodes (shards or replicas) in the instance | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Keys |
Total Key Count | Total number of keys stored in the instance (first-level keys) | Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Expired |
Expired Key Count | Number of keys evicted within the time window, corresponding to the expired_keys in the info command |
Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Evicted |
Evicted Key Count | Number of keys evicted within the time window, corresponding to the evicted_keys in the info command |
Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Connections |
Connection Count | Number of TCP connections to the instance | Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
ConnectionsUtil |
Connection Utilization | Ratio of actual TCP connections to maximum connections | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
InFlow |
Inbound Traffic | Intranet inbound traffic | Mb/s | instanceid |
5s, 60s, 300s, 3600s, 86400s |
InBandwidthUtil |
Inbound Traffic Utilization | Ratio of actual inbound traffic to maximum traffic | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
InFlowLimit |
Inbound Traffic Throttling Trigger | Number of times inbound traffic triggers throttling | Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
OutFlow |
Outbound Traffic | Intranet outbound traffic | Mb/s | instanceid |
5s, 60s, 300s, 3600s, 86400s |
OutBandwidthUtil |
Outbound Traffic Utilization | Ratio of actual outbound traffic to maximum traffic | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
OutFlowLimit |
Outbound Traffic Throttling Trigger | Number of times outbound traffic triggers throttling | Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyAvg |
Average Execution Latency | Average execution latency from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyMax |
Maximum Execution Latency | Maximum execution latency from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyRead |
Read Average Latency | Average execution latency for read commands from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyWrite |
Write Average Latency | Average execution latency for write commands from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyOther |
Other Commands Average Latency | Average execution latency for commands other than read/write from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Commands |
Total Requests | QPS, command execution count | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdRead |
Read Requests | Read command execution count per second | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdWrite |
Write Requests | Write command execution count per second | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdOther |
Other Requests | Command execution count per second for commands other than read/write | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdBigValue |
Large Value Requests | Number of command executions with values exceeding 32KB per second | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdKeyCount |
Key Request Count | Number of keys accessed by commands | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdMget |
Mget Request Count | Mget command execution count | Count/sec | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdSlow |
Slow Queries | Number of commands with execution latency greater than the slowlog-log-slower-than configuration |
Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdHits |
Read Request Hits | Number of read requests where the key exists, corresponding to the keyspace_hits metric in the info command |
Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdMiss |
Read Request Miss | Number of read requests where the key does not exist, corresponding to the keyspace_misses metric in the info command |
Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdErr |
Execution Errors | Number of command execution errors, such as command not found, parameter errors, etc. | Count | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdHitsRatio |
Read Request Hit Rate | Key Hits / (Key Hits + Key Misses), this metric can reflect Cache Miss situations | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Overview of Parameters for Each Dimension¶
Parameter Name | Dimension Name | Dimension Explanation | Format |
---|---|---|---|
Instances.N.Dimensions.0.Name |
instanceid |
Instance ID Dimension Name | Enter String type dimension name: instanceid |
Instances.N.Dimensions.0.Value |
instanceid |
Specific Instance ID | Enter the specific Redis instance ID, for example: tdsql-123456 or the instance serial number, for example: crs-ifmymj41 , which can be queried through the Query Redis Instance List API |
Instances.N.Dimensions.1.Name |
rnodeid |
Redis Node ID Dimension Name | Enter String type dimension name: rnodeid |
Instances.N.Dimensions.1.Value |
rnodeid |
Specific Redis Node ID | Enter the specific Redis node ID, which can be obtained through the Query Instance Node Information API |
Instances.N.Dimensions.1.Name |
pnodeid |
Proxy Node ID Dimension Name | Enter String type dimension name: pnodeid |
Instances.N.Dimensions.1.Value |
pnodeid |
Specific Proxy Node ID | Enter the specific proxy node ID, which can be obtained through the Query Instance Node Information API |
Instances.N.Dimensions.1.Name |
command |
Command Dimension Name | Enter String type dimension name: command |
Instances.N.Dimensions.1.Value |
command |
Specific Command | Enter the specific command, for example: ping, get, etc. |
Input Parameter Explanation¶
To query Tencent Cloud Redis instance monitoring data, the input parameters are as follows: &Namespace=QCE/REDIS_MEM &Instances.N.Dimensions.0.Name=instanceid &Instances.N.Dimensions.0.Value=Instance ID
To query Tencent Cloud Proxy node monitoring data, the input parameters are as follows: &Namespace=QCE/REDIS_MEM &Instances.N.Dimensions.0.Name=instanceid &Instances.N.Dimensions.0.Value=Instance ID &Instances.N.Dimensions.1.Name=pnodeid &Instances.N.Dimensions.1.Value=Proxy Node ID
To query Tencent Cloud Redis node monitoring data, the input parameters are as follows: &Namespace=QCE/REDIS_MEM &Instances.N.Dimensions.0.Name=instanceid &Instances.N.Dimensions.0.Value=Instance ID &Instances.N.Dimensions.1.Name=rnodeid &Instances.N.Dimensions.1.Value=Redis Node ID
To query Tencent Cloud Redis latency metrics (command dimension) monitoring data, the input parameters are as follows: &Namespace=QCE/REDIS_MEM &Instances.N.Dimensions.0.Name=instanceid &Instances.N.Dimensions.0.Value=Instance ID &Instances.N.Dimensions.1.Name=command &Instances.N.Dimensions.1.Value=Specific Command
Object¶
The collected Tencent Cloud Redis object data structure can be viewed in 「Infrastructure - Custom」.
{
"measurement": "tencentcloud_redis",
"tags": {
"name" : "crs-xxxx",
"BillingMode" : "0",
"Engine" : "Redis",
"InstanceId" : "crs-xxxx",
"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}"
}
}
Logging¶
Slow Query Statistics¶
Prerequisites for Slow Query Statistics¶
Note 1: The code execution of this script depends on Redis instance object collection. If Redis custom object collection is not configured, the slow log script cannot collect slow log data.
Slow Query Statistics Installation Script¶
On top of the previous steps, you need to install another script package for RDS Slow Query Statistics Log Collection.
In 「Management / Script Market」, click and install the corresponding script package:
- 「TrueWatch Integration (Tencent Cloud-Redis Slow Query Log Collection)」(ID:
integration_tencentcloud_redis_slowlog
)
After the data is synchronized normally, you can view the data in the 「Logs」 section of TrueWatch.
The reported data example is as follows:
{
"measurement": "tencentcloud_redis_slow_log",
"tags": {
"BillingMode" : "0",
"Client" : "",
"Engine" : "Redis",
"InstanceId" : "crs-rha4zlon",
"InstanceName": "crs-rha4zlon",
"Node" : "6d5d8cc6fxxxx",
"Port" : "6379",
"ProductType" : "standalone",
"ProjectId" : "0",
"RegionId" : "ap-shanghai",
"Status" : "2",
"Type" : "8",
"WanIp" : "172.17.0.9",
"ZoneId" : "200002",
"name" : "crs-xxxx"
},
"fields": {
"Command" : "config",
"CommandLine": "config get whitelist-ips",
"Duration" : 1,
"ExecuteTime": "2022-07-22 18:00:28",
"message" : "{Instance JSON Data}"
}
}
Partial parameter explanations are as follows:
Field | Type | Description |
---|---|---|
Duration |
Integer | Slow Query Duration |
Client |
String | Client Address |
Command |
String | Command |
CommandLine |
String | Detailed Command Line Information |
ExecuteTime |
String | Execution Time |
Node |
String | Node ID |
Note: The fields in
tags
andfields
may change with subsequent updates. Note 1:tags.name
value is the instance ID, used as a unique identifier. Note 2:fields.message
is a JSON serialized string.