Alibaba Cloud Redis/Tair Standard Edition
Alibaba Cloud Redis/Tair Standard Edition metrics display, including CPU usage, memory usage, disk read/write, network traffic, and access per second.
Configuration¶
Install Func¶
It is recommended to activate TrueWatch Integration - Extensions - DataFlux Func (Automata)
For self-deploying Func, refer to Self-deploying Func
Activate Script¶
Note: Please prepare the Alibaba Cloud AK in advance (for simplicity, you can directly grant the global read-only permission
ReadOnlyAccess
)
Activate Script for DataFlux Func (Automata)¶
- Log in to the TrueWatch console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- Click 【Add Cloud Account】, select 【Alibaba Cloud】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
- Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check whether the relevant configuration information is correct and retest
- Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
- Click the 【Integration】 button on the cloud account details page, find
Alibaba Cloud Redis Standard Edition
under theNot Installed
list, and click the 【Install】 button. The installation interface will pop up for installation.
Manually Activate Script¶
-
Log in to the Func console, click 【Script Market】, and enter the TrueWatch script market, search for:
integration_alibabacloud_redis
-
After clicking 【Install】, enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.
-
Click 【Deploy Startup Script】, the system will automatically create the
Startup
script set and automatically configure the corresponding startup script. -
After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to execute immediately without waiting for the scheduled time. After a while, you can check the execution task records and corresponding logs.
We have collected some configurations by default, see the Metrics section for details.
Metrics¶
After configuring Alibaba Cloud Cloud Monitor, the default Measurement is as follows. You can collect more metrics by configuration Alibaba Cloud Cloud Monitor Metrics Details
Metric Id | Metric Name | Dimensions | Statistics | Unit |
---|---|---|---|---|
StandardAvgRt | Average Response Time | userId,instanceId | Average,Maximum | us |
StandardBlockedClients | Blocked Client Connections | userId,instanceId | Average,Maximum | Count |
StandardConnectionUsage | Connection Usage Rate | userId,instanceId | Average,Maximum | % |
StandardCpuUsage | CPU Usage | userId,instanceId | Average,Maximum | % |
StandardHitRate | Hit Rate | userId,instanceId | Average,Maximum | % |
StandardIntranetIn | Inbound Traffic | userId,instanceId | Average,Maximum | KBytes/s |
StandardIntranetInRatio | Inbound Bandwidth Usage Rate | userId,instanceId | Average,Maximum | % |
StandardIntranetOut | Outbound Traffic | userId,instanceId | Average,Maximum | KBytes/s |
StandardIntranetOutRatio | Outbound Bandwidth Usage Rate | userId,instanceId | Average,Maximum | % |
StandardKeys | Number of Keys in Cache | userId,instanceId | Average,Maximum | Count |
StandardMemoryUsage | Memory Usage Rate | userId,instanceId | Average,Maximum | % |
StandardSyncDelayTime | Multi-Active Synchronization Delay | userId,instanceId | Average,Maximum | seconds |
StandardUsedConnection | Used Connections | userId,instanceId | Average,Maximum | Count |
StandardUsedMemory | Memory Usage | userId,instanceId | Average,Maximum | Bytes |
StandardUsedQPS | Average Access Per Second | userId,instanceId | Average,Maximum | Count |
Object¶
The object data structure of Alibaba Cloud Redis collected can be seen 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}"
}
}
Partial 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
,fields
may change with subsequent updatesNote:
fields.message
is a JSON serialized string