Queries the performance monitoring data of a Tair (Redis OSS-compatible) instance.
Operation description
You can also query the performance monitoring data of an instance in the Tair console. For more information, see Metrics .
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:DescribeHistoryMonitorValues | get | *DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the instance. | r-bp1zxszhcgatnx**** |
StartTime | string | Yes | The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2022-11-06T00:00:00Z |
EndTime | string | Yes | The end of the time range to query. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
You can query the monitoring data of the previous month. The maximum time range that you can specify for a query is seven days.
| 2022-11-06T00:30:00Z |
IntervalForHistory | string | Yes | This parameter is deprecated. Set the value to The interval at which a query is performed is automatically determined based on the start time and end time of the query. For example, if the query time range is less than or equal to 10 minutes, data is aggregated at a frequency of every 5 seconds and the results are returned at 5-second intervals. Note
| 01m |
MonitorKeys | string | No | The monitoring metrics. Separate the metrics with commas (,). Take CpuUsage as an example:
For more information about monitoring metrics and their descriptions, see Additional description of MonitorKeys. Note
| memoryUsage |
NodeId | string | No | The ID of the node in the instance. You can set this parameter to query the data of a specified node.
| r-bp1zxszhcgatnx****-db-0#1679**** |
NodeRole | string | No | If you want to query the metrics of the read replicas in a cloud-native read/write splitting instance, you must set this parameter to READONLY and specify NodeId. Note
In other cases, you do not need to specify this parameter or you can set this parameter to MASTER.
| READONLY |
Additional description of MonitorKeys
When you call the operation, you must specify the parameters in the MonitorKeys column of the following table. The system returns submetrics. General monitoring metrics and command-related monitoring metrics are available for instances.
General monitoring metrics
In this example, the CpuUsage metric is used to describe how to use a general monitoring metric.
-
Cluster or read/write splitting instances:
- To query the overall CPU utilization of all data nodes, you must specify CpuUsage$db.
- To query the CPU utilization of all proxy nodes, you must specify CpuUsage$proxy.
- To query the CPU utilization of a single data node or proxy node, you must specify CpuUsage and NodeId.
-
Standard master-replica instances: Specify only CpuUsage.
MonitorKeys | Submetric | Unit | Description | Applicable scope |
CpuUsage | CpuUsage | % | The CPU utilization. Valid values: 0 to 100. Note If the RedisCpuUsage parameter is specified or returned for your instance in the previous request, you can continue to use the parameter. |
|
MemoryUsage | memoryUsage | % | The memory usage. |
|
quotaMemory | quotaMemory | Bytes | The total memory of the data shard. |
|
UsedMemory | UsedMemory | Bytes | The amount of used memory, which includes the memory consumed by data and cache. |
|
Tair_PmemUsage | PmemUsage | % | The Persistent Memory (PMem) usage, the amount of PMem used, and the total amount of PMem. These submetrics are available only for persistent memory-optimized instances. |
|
Tair_Pmem | PmemUsed | Bytes | ||
PmemQuota | Bytes | |||
Redis_DetailedSpaceUsage | ins_size | MB | The total disk space used by the instance, the disk space used by data files such as append-only files (AOFs) and Redis Database (RDB) files, and the disk space used by logs such as active logs. These submetrics are available only for DRAM-based instances that are deployed in classic (local disk-based) mode. |
|
data_size | MB | |||
log_size | MB | |||
Redis_Memory_Monitor | used_memory_rss | Bytes | The physical memory used by the process, which is the memory allocated by the operating system to Tair. |
|
used_memory_lua | Bytes | The amount of memory used by Lua scripts. | ||
used_memory_startup | Bytes | The amount of memory used by Tair during startup. | ||
lazyfree_pending_objects | Counts | The number of keys pending to be reclaimed when Tair performs lazy free operations. | ||
used_memory_overhead | Bytes | The amount of memory that is used to support the internal mechanisms of Tair for maintaining datasets, including the output buffers, query buffers, and AOFs for all clients. | ||
used_memory_dataset | Bytes | The amount of memory used by data. | ||
UsedQPS | TotalQps | Counts/s | The total number of requests per second, including both read and write requests. |
|
GetQps | Counts/s | The number of read requests per second and the number of write requests per second. These submetrics are available only for instances that run Redis 4.0 or later. | ||
PutQps | Counts/s | |||
OtherOps | Counts/s | The number of non-read/write requests per second, such as PING, INFO, SELECT, and AUTH requests. For instances that contain proxy nodes, the OtherOps submetric indicates only the number of INFO requests per second. | ||
ConnectionUsage | connectionUsage | % | The connection usage, which is calculated by using the following formula: Number of used connections/Number of total supported connections. When the client connects to the cluster instance by using a private endpoint, this submetric is meaningful. |
|
UsedConnection | ConnCount | Counts | The number of used connections. | |
QPSUsage | qpsUsage | % | The queries per second (QPS) usage. |
|
IntranetIn | InFlow | KB/s | The inbound and outbound traffic rates. |
|
IntranetOut | OutFlow | KB/s | ||
IntranetInRatio | intranetInRatio | % | The inbound and outbound traffic usage. |
|
IntranetOutRatio | intranetOutRatio | % | ||
Redis_Avg_Rt_Monitor | AvgRt | us | The average response time of all commands, which indicates the average time that is measured from the time when a data node receives a command to the time when the data node returns the command output.
|
|
Redis_Max_Rt_Monitor | MaxRt | us | The maximum latency for commands, which indicates the maximum time period from the time when the replica node receives a command to the time when the replica node returns the command output.
| |
Redis_Basic_Monitor | Keys | Counts | The total number of keys, which indicates the number of primary keys stored in the instance. |
|
Expires | Counts | The number of keys that has a time to live (TTL) value configured. This submetric displays the instantaneous value when data is collected. | ||
ExpiredKeys | Counts | The total number of expired keys. | ||
EvictedKeys | Counts | The total number of evicted keys. | ||
ExpiredKeysPerSecond | Counts/s | The number of keys that are expired per second. | ||
EvictedKeysPerSecond | Counts/s | The number of keys that are evicted per second. | ||
inmem_keys | Counts | These submetics are available only for hybrid-storage instances (phased out). You can ignore these submetrics. | ||
swapped_keys | Counts | |||
Hit_Rate_Monitor | hit_rate | % | The hit ratio of keys, which is calculated by using the following formula: Total key hits/(Total key hits + Total key misses). |
|
hit | Counts | The number of key hits per second. | ||
miss | Counts | The number of key misses per second. | ||
evicted_keys_per_sec | Counts | The number of keys that are evicted per second. | ||
DiskUsage | disk_usage | % | The disk space usage, the size of the input buffer, the size of the output buffer, and the monitoring metrics related to disk performance. These submetics are available only for ESSD/SSD-based instances. |
|
RocksDBConn | Tair_Connection_Monitor | Bytes | ||
Tair_Connection_Monitor | Bytes | |||
Tair_Disk_Monitor | Submetrics such as io_bandwidth_kbps, iops, and iops_usage | |||
UsedConnection | ConnectionUsage | % | The connection usage, which is calculated by using the following formula: Number of used connections/Number of total supported connections. When the client connects to the cluster or read/write splitting instance by using a proxy node, this submetric is meaningful. |
|
UsedConnection | Counts | The number of used connections. | ||
NewUserConnQps | Counts/s | The number of connections that are established per second from clients to proxy nodes. | ||
Redis_Package_Monitor | request | Byte | The average bytes of a single request. |
|
response | Byte | The average bytes of a single response. | ||
request_max | Byte | The maximum bytes of a single request. | ||
response_max | Byte | The maximum bytes of a single response. | ||
RedisProxyConn | RedisUsedConnection | Counts | The number of connections that are established from proxy nodes to data nodes. | |
NewDBConnQps | Counts/s | The number of connections that are established per second from proxy nodes to data nodes. | ||
DisconnectDBConn | Counts | The cumulative number of disconnections from proxy nodes to data nodes. | ||
DisconnectUserConn | Counts | The cumulative number of disconnections from clients to proxy nodes. | ||
TotalCalls | TotalRefusedCommands | Counts | The cumulative number of rejected commands. | |
TotalCallsPerSecCalls | Counts/s | The QPS. | ||
TotalCallsPerSecRetryCalls | Counts/s | The number of request retries per second. | ||
TotalCallsPerSecRetryFailed | Counts/s | The number of failed requests per second. |
Response parameters
Examples
Sample success responses
JSON
format
{
"MonitorHistory": {
"2022-11-06T00:00:00Z": {
"memoryUsage": 6.67
},
"2022-11-06T00:00:05Z": {
"memoryUsage": 6.67
},
"2022-11-06T00:00:10Z": {
"memoryUsage": 6.67
},
"2022-11-06T00:00:15Z": {
"memoryUsage": 6.67
},
"2022-11-06T00:00:20Z": {
"memoryUsage": 6.67
},
"2022-11-06T00:00:25Z": {
"memoryUsage": 6.67
}
},
"RequestId": "F0997EE8-F4C2-4503-9168-85177ED7****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidStartTime.Malformed | The Specified parameter "StartTime" is not valid. |
400 | InvalidEndTime.Malformed | The Specified parameter "EndTime" is not valid. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2025-03-25 | API Description Update. The Error code has changed | View Change Details |
2024-05-08 | The Error code has changed. The request parameters of the API has changed | View Change Details |