Skip to content

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

Recommended to enable Guance integration - extension - DataFlux Func (Automata)

If you deploy Func yourself, refer to Self-deploy Func

Enable Script

Note: Please prepare the required Alibaba Cloud AK in advance (for simplicity, you can directly grant global read-only permission ReadOnlyAccess)

DataFlux Func (Automata) Enable Script

  1. Log in to Guance Console
  2. Click on the 【Integration】 menu, select 【Cloud Account Management】
  3. Click 【Add Cloud Account】, select 【Alibaba Cloud】, fill in the required information on the interface; if cloud account information has been configured before, ignore this step
  4. Click 【Test】, after testing successfully click 【Save】; if test fails, check whether the related configuration information is correct and retest
  5. Click on the 【Cloud Account Management】 list to see the added cloud accounts, click on the corresponding cloud account to enter the details page
  6. Click the 【Integration】 button on the cloud account detail page, under the Not Installed list, find Alibaba Cloud Redis Cluster Edition, click the 【Install】 button, a popup installation interface will appear for installation.

Manual Enable Script

  1. Log in to the Func console, click 【Script Market】, go to the official script market, search for guance_aliyun_redis

  2. After clicking 【Install】, input the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.

  3. Click 【Deploy Start Script】, the system will automatically create a Startup script set and configure the corresponding start-up script automatically.

  4. After enabling, you can see the corresponding automatic trigger configuration in 「Management / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute once without waiting for the regular time. Wait a moment, then you can view the execution task records and corresponding logs.

We default collect some configurations, detailed in the Metrics section

Metrics

Configure Alibaba Cloud - Cloud Monitor properly, and the default Measurement set is as follows. You can collect more Metrics through configuration Alibaba Cloud Cloud Monitor Metric Details

Metric Id Metric Name Dimensions Statistics Unit
ShardingAdminClients Proxy-to-DB connection count userId,instanceId,nodeId Average,Maximum Count
ShardingAvgRt Average response time userId,instanceId,nodeId Average,Maximum us
ShardingBlockedClients Blocked client connection count userId,instanceId,nodeId Average,Maximum Count
ShardingConnectionUsage Connection usage rate userId,instanceId,nodeId Average,Maximum %
ShardingCpuUsage CPU usage rate 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 rate userId,instanceId,nodeId Average,Maximum %
ShardingIntranetOut Outbound traffic userId,instanceId,nodeId Average,Maximum KBytes/s
ShardingIntranetOutRatio Outbound bandwidth usage rate userId,instanceId,nodeId Average,Maximum %
ShardingKeys Number of Keys in Cache userId,instanceId,nodeId Average,Maximum Count
ShardingMemoryUsage Memory usage rate userId,instanceId,nodeId Average,Maximum %
ShardingProxyAvgRequestSize Average bytes per Proxy request userId,instanceId,nodeId Average,Maximum Byte
ShardingProxyAvgResponseSize Average bytes per Proxy response userId,instanceId,nodeId Average,Maximum Byte
ShardingProxyAvgRt Average Proxy delay userId,instanceId,nodeId Average,Maximum us
ShardingProxyConnectionUsage Proxy connection usage rate userId,instanceId,nodeId Average,Maximum %
ShardingProxyCpuUsage Proxy CPU usage rate 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 bytes per Proxy request userId,instanceId,nodeId Average,Maximum Byte
ShardingProxyMaxResponseSize Maximum bytes per Proxy response userId,instanceId,nodeId Average,Maximum Byte
ShardingProxyTotalQps Total requests per second by Proxy userId,instanceId,nodeId Average,Maximum Count/s
ShardingProxyUsedConnection Used connections by Proxy 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

Objects

The object data structure collected for Alibaba Cloud Redis can be seen under "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 JSON data}]",
    "message"   : "{Instance JSON data}"
  }
}

Logs

Slow Queries

Prerequisites

Note: The code execution of this script depends on the collection of Redis instance objects. If custom object collection for Redis has not been configured, the slow log script will not be able to collect slow log data.

Installation Script

On top of the previous steps, you need to install an additional script for Redis slow query log collection

In the 「Management / Script Market」, click and install the corresponding script package: 「Guance Integration (Alibaba Cloud - Redis Slow Query Log Collection)」(ID: guance_aliyun_redis_slowlog)

After the data synchronizes normally, you can view the data in the 「Logs」 section of Guance.

An example of reported data 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}"
  }
}

Descriptions of some parameters are as follows:

Field Type Description
ElapsedTime int Execution duration, in milliseconds
ExecuteTime str Execution start time
IPAddress str Client's IP address

Note: Fields in tags and fields may change with subsequent updates.

Note: fields.message is a JSON serialized string

Feedback

Is this page helpful? ×