Skip to content

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 requests 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)

Automata Activation Script

  1. Log in to the TrueWatch console
  2. Click on the 【Integration】 menu and select 【Cloud Account Management】
  3. 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, ignore this step
  4. 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 test again
  5. Click on the 【Cloud Account Management】 list to see the added cloud account, click on the corresponding cloud account to enter the details page
  6. Click on the 【Integration】 button on the cloud account details page, find Alibaba Cloud Redis Standard Edition under the Not Installed list, and click on the 【Install】 button to install.

Manual Activation Script

  1. Log in to the Func console, click on 【Script Market】, enter the TrueWatch Script Market, and search for: integration_alibabacloud_redis

  2. Click on 【Install】, then enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.

  3. Click on 【Deploy Startup Script】, the system will automatically create the Startup script set and automatically configure the corresponding startup script.

  4. After activation, you can see the corresponding automatic trigger configuration in 「Manage / Automatic Trigger Configuration」. Click on 【Execute】 to execute it immediately without waiting for the scheduled time. After a while, you can view the execution task records and corresponding logs.

Metrics

After configuring Alibaba Cloud Cloud Monitor, the default Measurement is as follows. You can collect more Metrics through 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 Requests Per Second userId,instanceId Average,Maximum Count

Object

The object data structure collected from Alibaba Cloud Redis 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 Redis instance object collection. If Redis custom object collection is not configured, the slow log script cannot collect slow log data

Install Script

On the previous basis, you need to install another script package corresponding to Redis Slow Query Log Collection

In 「Manage / 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 「Logging」 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 updates

Note: fields.message is a JSON serialized string