Queries the performance monitoring information of an ApsaraDB for Tair (Redis® OSS-Compatible) database instance.
Operation description
For the console operation corresponding to this API, see Performance monitoring.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:DescribeHistoryMonitorValues |
get |
*DBInstance
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
r-bp1zxszhcgatnx****** |
| StartTime |
string |
Yes |
The start time of the query for historical monitoring data. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC). |
2022-11-06T00:00:00Z |
| EndTime |
string |
Yes |
The end time of the query for historical monitoring data. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC). Note
You can query monitoring data from the last month, and the maximum query range cannot exceed 7 days. |
2022-11-06T00:30:00Z |
| IntervalForHistory |
string |
Yes |
[Deprecated] This parameter is deprecated and has a fixed value of The system automatically determines the query interval based on the start time and end time. For example, if the query time range is less than or equal to 10 minutes, the data aggregation frequency is 5s, and the query results are returned at a frequency of 5s. Note
|
01m |
| MonitorKeys |
string |
No |
The monitoring metrics. To specify multiple monitoring metrics, separate them with commas (,). Using CpuUsage as an example:
For more monitoring metrics and detailed descriptions, see MonitorKeys parameter description. Note
|
CpuUsage |
| NodeId |
string |
No |
The node ID in the instance. Specify this parameter to query the monitoring information of a specific node. Note
|
r-bp1zxszhcgatnx****-db-0#1679**** |
| NodeRole |
string |
No |
To query the metrics of read-only nodes in a cloud-native read/write splitting architecture instance, specify the specific NodeId and set this parameter to READONLY. Note
In other cases, you do not need to specify this parameter (or specify MASTER). |
READONLY |
| Type |
string |
No |
MonitorKeys parameter description
When calling the OpenAPI, specify the parameters in the MonitorKeys column in the following table. The system returns the sub-metrics. Instances support general monitoring metrics and command statistics monitoring metrics.
General monitoring metrics
The following describes how to use general monitoring metrics. Using CpuUsage as an example:
-
Cluster or read/write splitting architecture:
To query the overall CPU usage of all data nodes (DB): Specify CpuUsage$db.
To query the overall CPU usage of all Proxy nodes: Specify CpuUsage$proxy.
To query the CPU usage of a single data node or Proxy node: Specify CpuUsage and set the NodeId parameter to the DB node or Proxy node.
-
Standard architecture (primary/secondary): Specify CpuUsage.
MonitorKeys | Sub-metric | Unit | Description | Supported scope |
CpuUsage | CpuUsage | % | The CPU usage. Value range: 0 to 100. Note If your instance previously used or returned the RedisCpuUsage parameter, you can still use the original parameter. |
|
MemoryUsage | memoryUsage | % | The memory usage. |
|
quotaMemory | quotaMemory | Bytes | The total memory of the current shard. |
|
UsedMemory | UsedMemory | Bytes | The used memory, including data and cache. |
|
Tair_PmemUsage | PmemUsage | % | The persistent memory usage, used persistent memory, and total persistent memory, respectively. Only persistent memory-optimized instances support this metric. |
|
Tair_Pmem | PmemUsed | Bytes | ||
PmemQuota | Bytes | |||
Redis_DetailedSpaceUsage | ins_size | MB | The total instance storage space, the disk space used by data files (including AOF and RDB files), and the disk space used by log files (including operation logs), respectively. Only memory-optimized instances in classic deployment mode (formerly local disk) support this metric. |
|
data_size | MB | |||
log_size | MB | |||
Redis_Memory_Monitor | used_memory_rss | Bytes | The physical memory occupied by the process, which is the memory allocated by the operating system to the Tair service. |
|
used_memory_lua | Bytes | The memory used by Lua scripts. | ||
used_memory_startup | Bytes | The memory consumed when Tair starts. | ||
lazyfree_pending_objects | Counts | The number of keys pending actual memory reclamation during Tair lazy free operations. | ||
used_memory_overhead | Bytes | The memory overhead required by Tair to maintain internal mechanisms of the dataset, including output buffers of all clients, query buffers, and AOF. | ||
used_memory_dataset | Bytes | The memory space occupied by data. | ||
CustomerMemoryUsage | CustomerMemoryUsage | % | The user memory usage. Value range: 0 to 100. |
|
UsedQPS | TotalQps | Counts/s | The total number of requests per second, including read and write commands. |
|
GetQps | Counts/s | The number of read and write command requests per second, respectively. The compatible version of the instance must be Redis 4.0 or later. | ||
PutQps | Counts/s | |||
OtherOps | Counts/s | Requests without read or write attributes, such as PING, INFO, SELECT, and AUTH. Because Proxy performs special processing on requests, if the instance has Proxy nodes, OtherOps includes only some INFO requests. | ||
ConnectionUsage | connectionUsage | % | The connection usage. Calculation method: number of used connections ÷ total number of connections supported by the instance. This metric is useful when clients connect to a Tair instance (cluster architecture) through a direct connection address. |
|
UsedConnection | ConnCount | Counts | The number of used connections. | |
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 latency, which indicates the average time from when the backend node receives a command to when it sends a response.
|
|
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| MonitorHistory |
string |
The monitoring information returned in JSON format. For more information, see Monitoring parameter description. Note
To improve data transmission efficiency, only non-zero monitoring data is returned. All other monitoring data that is not displayed has a default value of 0. |
"{\"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 |
string |
The request ID. |
F0997EE8-F4C2-4503-9168-85177ED7**** |
| MonitorLegend |
string |
Examples
Success response
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****",
"MonitorLegend": ""
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.Malformed | The Specified parameter "StartTime" is not valid. | |
| 400 | InvalidEndTime.Malformed | The Specified parameter "EndTime" is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.