Skip to content

Tencent Cloud Redis

Tencent Cloud Redis Metrics, including connections, requests, latency, slow queries, etc.

Configuration

Install Func

It is recommended to activate Guance Integration - Extensions - DataFlux Func (Automata): All prerequisites are automatically installed, please proceed with script installation.

For self-deployed Func, refer to Self-deployed Func

Activate Script

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

Automata Activation Script

  1. Log in to the Guance console.
  2. Click the [Integration] menu, select [Cloud Account Management].
  3. Click [Add Cloud Account], select [Tencent Cloud], and fill in the required information on the interface. If the cloud account information has been configured before, ignore this step.
  4. 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.
  5. 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.
  6. Click the [Integration] button on the cloud account details page, find Tencent Cloud Redis under the Not Installed list, and click the [Install] button to pop up the installation interface for installation.

Manual Activation Script

  1. Log in to the Func console, click [Script Market], enter the Guance script market, and search for integration_tencentcloud_redis.

  2. Click [Install], then enter the corresponding parameters: Tencent Cloud AK, SK, and account name.

  3. Click [Deploy Startup Script], the system will automatically create the Startup script set and automatically configure the corresponding startup script.

  4. After enabling, you can see the corresponding automatic trigger configuration in "Management / Automatic Trigger Configuration". Click [Execute] to execute it immediately without waiting for the scheduled time. Wait a moment, you can view the execution task record and corresponding logs.

Verification

  1. In "Management / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and you can also check the corresponding task record and logs to see if there are any exceptions.
  2. In Guance, check whether asset information exists in "Infrastructure / Custom".
  3. In Guance, check whether there is corresponding monitoring data in "Metrics".

Metrics

After configuring Tencent Cloud-Redis, the default Measurement is as follows. You can collect more metrics by configuring Tencent Cloud Cloud Monitoring Metrics Details

Redis Instance Monitoring

Metric Name Metric Chinese Name Description Unit Dimension Statistical Granularity
CpuUtil CPU Utilization Average CPU Utilization % instanceid 5s, 60s, 300s, 3600s, 86400s
CpuMaxUtil Node Maximum CPU Utilization Maximum CPU Utilization of 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 of 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 Times 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 Times 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 execution latency of read commands from Proxy to Redis Server ms instanceid 5s, 60s, 300s, 3600s, 86400s
LatencyWrite Write Average Latency Average execution latency of write commands 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 and write commands from Proxy to Redis Server ms instanceid 5s, 60s, 300s, 3600s, 86400s
Commands Total Requests QPS, number of command executions Times/second instanceid 5s, 60s, 300s, 3600s, 86400s
CmdRead Read Requests Number of read command executions per second Times/second instanceid 5s, 60s, 300s, 3600s, 86400s
CmdWrite Write Requests Number of write command executions per second Times/second instanceid 5s, 60s, 300s, 3600s, 86400s
CmdOther Other Requests Number of command executions other than read and write commands per second Times/second instanceid 5s, 60s, 300s, 3600s, 86400s
CmdBigValue Large Value Requests Number of command executions with command size exceeding 32KB per second Times/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 Number of Mget command executions Count/second instanceid 5s, 60s, 300s, 3600s, 86400s
CmdSlow Slow Queries Number of commands with execution latency greater than the slowlog - log - slower - than configuration Times 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 Times instanceid 5s, 60s, 300s, 3600s, 86400s
CmdMiss Read Request Misses Number of read requests where the key does not exist, corresponding to the keyspace_misses metric of the info command Times instanceid 5s, 60s, 300s, 3600s, 86400s
CmdErr Execution Errors Number of command execution errors, such as command does not exist, parameter errors, etc. Times instanceid 5s, 60s, 300s, 3600s, 86400s
CmdHitsRatio Read Request Hit Rate Key Hits / (Key Hits + Key Misses), this metric can reflect Cache Miss situations % instanceid 5s, 60s, 300s, 3600s, 86400s

Overview of Parameters Corresponding to Each Dimension

Parameter Name Dimension Name Dimension Explanation Format
Instances.N.Dimensions.0.Name instanceid Instance ID Dimension Name Enter String type dimension name: instanceid
Instances.N.Dimensions.0.Value instanceid Specific Instance ID Enter the 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 Enter String type dimension name: rnodeid
Instances.N.Dimensions.1.Value rnodeid Specific Redis Node ID Enter the specific Redis node ID, can be obtained via Query Instance Node Information API
Instances.N.Dimensions.1.Name pnodeid Proxy Node ID Dimension Name Enter String type dimension name: pnodeid
Instances.N.Dimensions.1.Value pnodeid Specific Proxy Node ID Enter the specific proxy node ID, can be obtained via Query Instance Node Information API
Instances.N.Dimensions.1.Name command Command Word Dimension Name Enter String type dimension name: command
Instances.N.Dimensions.1.Value command Specific Command Word Enter specific command word, for example: ping, get, etc.

Input Parameter Description

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

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

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

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

The collected Tencent Cloud Redis object data structure can be seen 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}"
  }
}

Log

Slow Query Statistics

Prerequisites for Slow Query Statistics

Note 1: 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.

Slow Query Statistics Installation Script

On the previous basis, you need to install a corresponding RDS Slow Query Statistics Log Collection Script.

In "Management / Script Market", click and install the corresponding script package:

  • 「Guance Integration (Tencent Cloud-Redis Slow Query Log Collection) 」(ID: integration_tencentcloud_redis_slowlog)

After the data is synchronized normally, you can view the data in the "Log" of Guance.

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 description is 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.

Feedback

Is this page helpful? ×