Alibaba Cloud Redis/Tair Cluster Edition
Alibaba Cloud Redis/Tair Cluster Edition Metrics display, including CPU usage, memory usage, disk read/write, network traffic, requests per second, etc.
Configuration¶
Install Func¶
It is recommended to activate the TrueWatch Integration - Extensions - DataFlux Func (Automata)
For self-deploying Func, refer to Self-deploying Func
Activate Script¶
Note: Please prepare the Alibaba Cloud AK with the required permissions in advance (for simplicity, you can grant the global read-only permission
ReadOnlyAccess
)
Activate Script for Automata¶
- Log in to the TrueWatch console
- Click on the 【Integration】 menu, select 【Cloud Account Management】
- Click on 【Add Cloud Account】, select 【Alibaba Cloud】, and fill in the required information on the interface. If the cloud account information has been configured before, skip this step
- Click on 【Test】, and after the test is successful, click on 【Save】. If the test fails, please check if the relevant configuration information is correct and retest
- Click on the 【Cloud Account Management】 list to see the added cloud account, click on the corresponding cloud account to enter the details page
- Click on the 【Integration】 button on the cloud account details page, find
Alibaba Cloud Redis Cluster Edition
under theNot Installed
list, click on the 【Install】 button, and install it in the pop-up installation interface.
Activate Script Manually¶
-
Log in to the Func console, click on 【Script Market】, enter the TrueWatch script market, and search for:
integration_alibabacloud_redis
-
Click on 【Install】, then enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.
-
Click on 【Deploy Startup Script】, the system will automatically create a
Startup
script set and configure the corresponding startup script. -
After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click on 【Execute】 to execute it immediately without waiting for the scheduled time. Wait a moment, you can view the execution task records and corresponding logs.
Metrics¶
After configuring Alibaba Cloud Cloud Monitor, the default Measurement is as follows. More Metrics can be collected through configuration Alibaba Cloud Cloud Monitor Metrics Details
Metric Id | Metric Name | Dimensions | Statistics | Unit |
---|---|---|---|---|
ShardingAdminClients | Proxy to DB Connections | userId,instanceId,nodeId | Average,Maximum | Count |
ShardingAvgRt | Average Response Time | userId,instanceId,nodeId | Average,Maximum | us |
ShardingBlockedClients | Blocked Client Connections | userId,instanceId,nodeId | Average,Maximum | Count |
ShardingConnectionUsage | Connection Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingCpuUsage | CPU Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingHitRate | Hit Rate | userId,instanceId,nodeId | Average,Maximum | % |
ShardingInstProxyIntranetIn | Proxy Instance Inbound Bandwidth | userId,instanceId | Value | KBytes/s |
ShardingInstProxyIntranetOut | Proxy Instance Outbound Bandwidth | userId,instanceId | Value | KBytes/s |
ShardingInstProxyTotalQps | Proxy Instance Total Requests Per Second | userId,instanceId | Value | Count/s |
ShardingInstProxyUsedConnection | Proxy Instance Used Connections | userId,instanceId | Value | Count |
ShardingIntranetIn | Inbound Traffic | userId,instanceId,nodeId | Average,Maximum | KBytes/s |
ShardingIntranetInRatio | Inbound Bandwidth Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingIntranetOut | Outbound Traffic | userId,instanceId,nodeId | Average,Maximum | KBytes/s |
ShardingIntranetOutRatio | Outbound Bandwidth Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingKeys | Number of Keys in Cache | userId,instanceId,nodeId | Average,Maximum | Count |
ShardingMemoryUsage | Memory Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingProxyAvgRequestSize | Average Request Size of Proxy | userId,instanceId,nodeId | Average,Maximum | Byte |
ShardingProxyAvgResponseSize | Average Response Size of Proxy | userId,instanceId,nodeId | Average,Maximum | Byte |
ShardingProxyAvgRt | Average Latency of Proxy | userId,instanceId,nodeId | Average,Maximum | us |
ShardingProxyConnectionUsage | Proxy Connection Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingProxyCpuUsage | Proxy CPU Usage | userId,instanceId,nodeId | Average,Maximum | % |
ShardingProxyIntranetIn | Proxy Inbound Traffic Rate | userId,instanceId,nodeId | Average,Maximum | KBytes/s |
ShardingProxyIntranetOut | Proxy Outbound Traffic Rate | userId,instanceId,nodeId | Average,Maximum | KBytes/s |
ShardingProxyMaxRequestSize | Maximum Request Size of Proxy | userId,instanceId,nodeId | Average,Maximum | Byte |
ShardingProxyMaxResponseSize | Maximum Response Size of Proxy | userId,instanceId,nodeId | Average,Maximum | Byte |
ShardingProxyTotalQps | Total Requests Per Second of Proxy | userId,instanceId,nodeId | Average,Maximum | Count/s |
ShardingProxyUsedConnection | Proxy Used Connections | userId,instanceId,nodeId | Average,Maximum | Count |
ShardingSyncDelayTime | Multi-Active Synchronization Delay | userId,instanceId,nodeId | Maximum,Average | seconds |
ShardingUsedConnection | Used Connections | userId,instanceId,nodeId | Average,Maximum | Count |
ShardingUsedMemory | Memory Usage | userId,instanceId,nodeId | Average,Maximum | Bytes |
ShardingUsedQPS | Average Requests Per Second | userId,instanceId,nodeId | Average,Maximum | Count |
Object¶
The collected Alibaba Cloud Redis object data structure can be viewed in 「Infrastructure - Custom」
{
"measurement": "aliyun_redis",
"tags": {
"name" : "r-bp12xxxxxxx",
"InstanceId" : "r-bp12vxxxxxxxxx",
"RegionId" : "cn-hangzhou",
"ZoneId" : "cn-hangzhou-h",
"InstanceClass" : "redis.master.small.default",
"EngineVersion" : "5.0",
"ChargeType" : "PrePaid",
"ConnectionDomain": "r-bp12vxxxxxxx.redis.rds.aliyuncs.com",
"NetworkType" : "VPC",
"PrivateIp" : "xxxxxx",
"Port" : "6379",
"InstanceName" : "xxx System",
"InstanceType" : "Redis",
"InstanceStatus" : "Normal"
},
"fields": {
"Capacity" : "1024",
"EndTime" : "2022-12-13T16:00:00Z",
"CreateTime": "2021-01-11T09:35:51Z",
"Accounts" : "[{Account Information JSON Data}]",
"message" : "{Instance JSON Data}"
}
}
Logging¶
Slow Query¶
Prerequisites¶
Note: The code execution of this script depends on the Redis instance object collection. If the custom object collection of Redis is not configured, the slow log script cannot collect slow log data
Install Script¶
On the previous basis, you need to install a corresponding Redis Slow Query Log Collection Script
In 「Management / Script Market」, click and install the corresponding script package: 「TrueWatch Integration (Alibaba Cloud - Redis Slow Query Log Collection)」(ID: integration_alibabacloud_redis_slowlog
)
After the data is synchronized normally, you can view the data in the 「Log」 of TrueWatch.
The reported data example is as follows:
{
"measurement": "aliyun_redis_slowlog",
"tags": {
"name" : "r-bp1c4xxxxxxxofy2vm",
"Account" : "(null)",
"IPAddress" : "172.xx.x.201",
"AccountName" : "(null)",
"DBName" : "3",
"NodeId" : "(null)",
"ChargeType" : "PrePaid",
"ConnectionDomain": "r-bpxxxxxxxxxxy2vm.redis.rds.aliyuncs.com",
"EngineVersion" : "4.0",
"InstanceClass" : "redis.master.small.default",
"InstanceId" : "r-bpxxxxxxxxxxxxxxx2vm",
"InstanceName" : "xx3.0-xx System",
"NetworkType" : "VPC",
"Port" : "6379",
"PrivateIp" : "172.xxx.xx.200",
"RegionId" : "cn-hangzhou",
"ZoneId" : "cn-hangzhou-h"
},
"fields": {
"Command" : "latency:eventloop",
"ElapsedTime": 192000,
"ExecuteTime": "2022-07-26T03:18:36Z",
"message" : "{Instance JSON Data}"
}
}
Some parameter descriptions are as follows:
Field | Type | Description |
---|---|---|
ElapsedTime |
int | Execution duration, in milliseconds |
ExecuteTime |
str | Execution start time |
IPAddress |
str | Client IP address |
Note: The fields in
tags
andfields
may change with subsequent updatesNote:
fields.message
is a JSON serialized string