Tencent Cloud Redis¶
Tencent Cloud Redis Metrics display, including connections, requests, latency, slow queries, etc.
Configuration¶
Install Func¶
It is recommended to enable TrueWatch Integration - Extensions - DataFlux Func (Automata): All prerequisites are automatically installed, please proceed with script installation.
If deploying 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 directly grant global read-only permissions
ReadOnlyAccess
).
To synchronize Tencent Cloud-Redis monitoring data, we install the corresponding collection script: "TrueWatch Integration (Tencent Cloud-Redis Collection)" (ID: integration_tencentcloud_redis
).
Click 【Install】, then input the corresponding parameters: Tencent Cloud AK, Tencent Cloud account name.
Click 【Deploy Startup Script】, the system will automatically create a Startup
script set and configure the corresponding startup scripts.
Additionally, in 「Manage / Auto Trigger Configuration」, you can see the corresponding auto-trigger configuration. Click 【Execute】 to immediately execute once without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
We have collected some configurations by default, for details see the Metrics section Configure Custom Cloud Object Metrics
Verification¶
- In 「Manage / Auto Trigger Configuration」, confirm whether the corresponding task exists in the auto-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 there is corresponding monitoring data in 「Metrics」.
Metrics¶
After configuring Tencent Cloud-Redis, the default Measurement is as follows. More Metrics can be collected through configuration Tencent Cloud Monitoring Metrics Details
Redis Instance Monitoring¶
Metric Name | Metric Description | Description | Unit | Dimension | Statistics 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 output of 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 output of 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 | Internal network inbound traffic | Mb/s | instanceid |
5s, 60s, 300s, 3600s, 86400s |
InBandwidthUtil |
Inbound Traffic Utilization | Ratio of actual internal network 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 | Internal network outbound traffic | Mb/s | instanceid |
5s, 60s, 300s, 3600s, 86400s |
OutBandwidthUtil |
Outbound Traffic Utilization | Ratio of actual internal network 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 read command execution latency from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyWrite |
Write Average Latency | Average write command execution latency from Proxy to Redis Server | ms | instanceid |
5s, 60s, 300s, 3600s, 86400s |
LatencyOther |
Other Commands Average Latency | Average execution latency of 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/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdRead |
Read Requests | Read command execution count per second | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdWrite |
Write Requests | Write command execution count per second | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdOther |
Other Requests | Command execution count per second other than read/write | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdBigValue |
Large Value Requests | Command execution count per second with command size exceeding 32KB | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdKeyCount |
Key Request Count | Number of keys accessed by commands | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdMget |
Mget Request Count | Mget command execution count | count/second | instanceid |
5s, 60s, 300s, 3600s, 86400s |
CmdSlow |
Slow Queries | Command execution count with execution latency greater than 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 of 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 of 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 situation | % | instanceid |
5s, 60s, 300s, 3600s, 86400s |
Overview of Parameters for Each Dimension¶
Parameter Name | Dimension Name | Dimension Description | Format |
---|---|---|---|
Instances.N.Dimensions.0.Name |
instanceid |
Instance ID Dimension Name | Input String type dimension name: instanceid |
Instances.N.Dimensions.0.Value |
instanceid |
Specific Instance ID | Input specific Redis instance ID, for example: tdsql-123456 or instance serial number, for example: crs-ifmymj41 , can be queried via Query Redis Instance List API |
Instances.N.Dimensions.1.Name |
rnodeid |
Redis Node ID Dimension Name | Input String type dimension name: rnodeid |
Instances.N.Dimensions.1.Value |
rnodeid |
Specific Redis Node ID | Input specific Redis node ID, can be obtained via Query Instance Node Information API |
Instances.N.Dimensions.1.Name |
pnodeid |
Proxy Node ID Dimension Name | Input String type dimension name: pnodeid |
Instances.N.Dimensions.1.Value |
pnodeid |
Specific Proxy Node ID | Input specific proxy node ID, can be obtained via Query Instance Node Information API |
Instances.N.Dimensions.1.Name |
command |
Command Word Dimension Name | Input String type dimension name: command |
Instances.N.Dimensions.1.Value |
command |
Specific Command Word | Input specific command word, for example: ping, get, etc. |
Input Parameter Description¶
To query Tencent Cloud Redis instance monitoring data, 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, 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, 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, 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 Word
Object¶
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 setup, you need to install another corresponding RDS Slow Query Statistics Log Collection Script.
In 「Manage / Script Market」, click and install the corresponding script package:
- "TrueWatch Integration (Tencent Cloud-Redis Slow Query Log Collection)" (ID:
integration_tencentcloud_redis_slowlog
)
After data synchronization is normal, you can view the data in TrueWatch's 「Logs」.
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 descriptions 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: Fields in
tags
,fields
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.