All Products
Search
Document Center

Tair (Redis® OSS-Compatible):DescribeHistoryMonitorValues

Last Updated:Oct 30, 2024

Queries the performance monitoring data of an ApsaraDB for Redis instance.

Operation description

You can also query the performance monitoring data of an instance in the ApsaraDB for Redis console. For more information, see Metrics .

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • The required resource types are displayed in bold characters.
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
kvstore:DescribeHistoryMonitorValuesget
  • DBInstance
    acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}
  • kvstore:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

r-bp1zxszhcgatnx****
StartTimestringYes

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
EndTimestringYes

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.

  • You can query the monitoring data of the last month. The maximum time range that you can specify for a query is seven days.
  • If the number of data nodes in the instance is greater than 32, the time range to query for the Data Node Aggregation and Proxy Node Aggregation metrics cannot exceed 1 hour.
2022-11-06T00:30:00Z
IntervalForHistorystringYes

The interval at which to collect monitoring data. Unit: minutes. Set the value to 01m.

01m
MonitorKeysstringNo

The monitoring metrics. Separate the metrics with commas (,). Take CpuUsage as an example:

  • Cluster or read/write splitting instances

    • To query the overall CPU utilization of all data nodes, specify CpuUsage$db.
    • To query the CPU utilization of a single data node, specify CpuUsage and NodeId.
  • Standard master-replica instances: Specify only CpuUsage.

For more information about monitoring metrics and their descriptions, see Additional description of MonitorKeys.

Note
  • This parameter is empty by default, which indicates that the UsedMemory and quotaMemory metrics are returned.

  • To ensure query efficiency, we recommend that you specify no more than five metrics for a single node at a time, and specify only a single metric when you query aggregate metrics.

memoryUsage
NodeIdstringNo

The ID of the node in the instance. You can set this parameter to query the data of a specified node.

  • This parameter is available only for read/write splitting or cluster instances of ApsaraDB for Redis.

  • You can call the DescribeLogicInstanceTopology operation to query node IDs.

r-bp1zxszhcgatnx****-db-0#1679****
NodeRolestringNo

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.

MonitorKeysSubmetricUnitDescriptionApplicable scope
CpuUsageCpuUsage%The CPU utilization. Valid values: 0 to 100.
NoteIf the RedisCpuUsage parameter is specified or returned for your instance in the previous request, you can continue to use the parameter.
  • DB

  • Database aggregation

  • Proxy

  • Proxy node aggregation

MemoryUsagememoryUsage%The memory usage.
  • DB

  • Database aggregation

quotaMemoryquotaMemoryBytesThe total memory of the data shard.
  • DB

  • Database aggregation

UsedMemoryUsedMemoryBytesThe amount of used memory, which includes the memory consumed by data and cache.
  • DB

  • Database aggregation

Tair_PmemUsagePmemUsage%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.|

  • DB

  • Database aggregation

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

  • DB

  • Database aggregation

| |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.|
  • DB

| |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.|
  • DB

  • Database aggregation

  • Proxy

  • Proxy node aggregation

| |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.|
  • DB

  • Database aggregation

| |UsedConnection|ConnCount|Counts|The number of used connections.| |QPSUsage|qpsUsage|%|The queries per second (QPS) usage.|
  • DB

| |IntranetIn|InFlow|KB/s|The inbound and outbound traffic rates.|
  • DB

  • Database aggregation

  • Proxy

  • Proxy node aggregation

| |IntranetOut|OutFlow|KB/s| |IntranetInRatio|intranetInRatio|%|The inbound and outbound traffic usage.|
  • DB

  • Database aggregation

| |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.|
  • DB

  • Database aggregation

  • Proxy

  • Proxy node aggregation

| |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.|
  • DB

  • Database aggregation

| |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).|
  • DB

  • Database aggregation

| |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.|
  • DB

| |RocksDBConn|Tair_Connection_Monitor|Bytes| |Tair_Connection_Monitor|Bytes| |Tair_Disk_Monitor|Submetrics such as io_bandwidth_kbps, iops, and iops_usage|Units such as % and ms| |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.|
  • Proxy

  • Proxy node aggregation

| |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.|
  • Proxy

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

Command-related monitoring metrics (expand to view the metrics)

Command-related monitoring metrics are supported only when you query a specific database. When you query the monitoring data of a specific database, you must specify the MonitorKeys and NodeId parameters. Note Monitoring metrics related to extended data structures of Tair are available only for DRAM-based instances that are deployed in classic (local-disk based) mode.

MonitorKeysSubmetricUnitDescription
Redis_Keys_Monitordel, dump, exists, expire, expireat, move, persist, pexpire, pexpireat, pttl, randomkey, rename, renamenx, restore, sort, ttl, type, and scanCounts/sThe monitoring information about the use of key-value related commands, such as the number of times DEL and EXISTS are executed per second.
Redis_String_Monitorappend, bitcount, bitop, decr, decrby, get, getbit, getrange, getset, incr, incrby, incrbyfloat, mget, mset, msetnx, psetex, set, setbit, setex, setnx, setrange, and strlenCounts/sThe monitoring information about the use of string-related commands, such as the number of times APPEND and MGET are executed per second.
Redis_Hashes_Monitorhdel, hexists, hget, hgetall, hincrby, hincrbyfloat, hkeys, hlen, hmget, hmset, hset, hsetnx, hvals, and hscanCounts/sThe monitoring information about the use of hash-related commands, such as the number of times HGET and HDEL are executed per second.
Redis_Lists_Monitorblpop, brpop, brpoplpush, lindex, linsert, llen, lpop, lpush, lpushx, lrange, lrem, lset, ltrim, rpop, rpoplpush, rpush, and rpushxCounts/sThe monitoring information about the use of list-related commands, such as the number of times BLPOP and BRPOP are executed per second.
Redis_Sets_Monitorsadd, scard, sdiff, sdiffstore, sinter, sinterstore, sismember, smembers, smove, spop, srandmember, srem, sunion, sunionstore, and sscanCounts/sThe monitoring information about the use of set-related commands, such as the number of times SADD and SCARD are executed per second.
Redis_Zset_Monitorzadd, zcard, zcount, zincrby, zrange, zrangebyscore, zrank, zrem, zremrangebyrank, zremrangebyscore, zrevrange, zrevrangebyscore, zrevrank, zscore, zunionstore, zinterstore, zscan, zrangebylex, zlexcount, zremrangebylex, zpopmin, zpopmax, bzpopmin, and bzpopmaxCounts/sThe monitoring information about the use of zset-related commands, such as the number of times ZADD and ZCARD are executed per second.
Redis_Hyperlog_Monitorpfadd, pfcount, and pfmergeCounts/sThe monitoring information about the use of HyperLogLog-related commands, such as the number of times PFADD and PFCOUNT are executed per second.
Redis_Pub_Sub_Monitorpsubscribe, publish, pubsub, punsubscribe, subscribe, and unsubscribeCounts/sThe monitoring information about the use of commands related to the Pub/Sub command group, such as the number of times PUBLISH and SUBSCRIBE are executed per second.
Redis_Transaction_Monitordiscard, exec, multi, unwatch, and watchCounts/sThe monitoring information about the use of transaction-related commands, such as the number of times WATCH and MULTI are executed per second.
Redis_Scripting_Monitoreval, evalsha, and scriptCounts/sThe monitoring information about the use of scripting-related commands, such as the number of times EVAL and EVALSHA are executed per second.
Calls_Monitorflushall_calls, flushdb_calls, and keys_callsCountsThe cumulative number of times FLUSHALL, FLUSHDB, and KEYS are executed per second.
Redis_Connection_Monitorauth, echo, ping, quit, and selectCounts/sThe monitoring information about the use of connection-related commands, such as the number of times AUTH and ECHO are executed per second.
Redis_Server_Monitorbgsave, client, command, config, dbsize, debug, flushall, flushdb, info, monitor, slowlog, and timeCounts/sThe monitoring information about the use of server-related commands, such as the number of times BGSAVE and CONFIG are executed per second.
Redis_Geo_Monitorgeoadd, geohash, geopos, geodist, georadius, and georadiusbymemberCounts/sThe monitoring information about the use of geo-related commands, such as the number of times GEOADD and GEOHASH are executed per second.
Redis_Streams_Monitorxinfo, xadd, xtrim, xdel, xrange, xrevrange, xlen, xread, xgroup, xreadgroup, xack, xclaim, and xpendingCounts/sThe monitoring information about the use of stream-related commands, such as the number of times XINFO and XADD are executed per second.
Counts/sLua , EVAL、SCRIPT 。
Redis_TairDoc_Monitorjsondel, jsonget, jsonmget, jsonset, jsontype, jsonnumincrby, jsonstrappend, jsonstrlen, jsonarrappend, jsonarrpop, jsonarrinsert, jsonarrlen, and jsonarrtrimCounts/sThe monitoring information about the use of Doc-related commands, such as the number of times JSON.SET and JSON.GET are executed per second.
Redis_TairHash_Monitorexhset, exhsetnx, exhmset, exhexpireat, exhexpire, exhmsetwithopts, exhpexpireat, exhpexpire, exhpttl, exhttl, exhver, exhsetver, exhincrby, exhincrbyfloat, exhget, exhgetwithver, exhmget, exhdel, exhlen, exhexists, exhkeys, exhvals, exhgetall, exhmgetwithver, exhsterlen, and exhscanCounts/sThe monitoring information about the use of exHash-related commands, such as the number of times EXHSET and EXHMSET are executed per second.
Redis_TairString_Monitorcas, cad, exset, exget, exsetver, exincrby, exincrbyfloat, excas, and excadCounts/sThe monitoring information about the use of exString-related commands, such as the number of times EXSET and EXGET are executed per second.
Redis_TairGis_Monitorgisadd, gisget, gisdel, gissearch, giscontains, gisintersects, and gisgetallCounts/sThe monitoring information about the use of GIS-related commands, such as the number of times GIS.ADD, GIS.GET, and GIS.DEL are executed per second.
Redis_TairBloom_Monitorbfadd, bfmadd, bfexists, bfmexists, bfinsert, bfreserve, and bfdebugCounts/sThe monitoring information about the use of Bloom-related commands, such as the number of times BF.RESERVE and BF.ADD are executed per second.

Response parameters

ParameterTypeDescriptionExample
object
MonitorHistorystring

The monitoring information returned in the JSON format. For more information, see View performance monitoring data.

  • Only metrics whose values are not 0 are returned. This improves data transmission efficiency. Metrics that are not displayed are represented by the 0 default value.

  • The query result is aligned with the data aggregation frequency. If the specified time range to query is less than or equal to 10 minutes and the data is aggregated once every 5 seconds, query results are returned at an interval of 5 seconds. If the specified StartTime value does not coincide with a point in time for data aggregation, the system returns the latest point in time for data aggregation as the first point in time. For example, if you set the StartTime parameter to 2022-01-20T12:01:48Z, the first point in time returned is 2022-01-20T12:01:45Z.

"{\"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\"}}"
RequestIdstring

The ID of the request.

F0997EE8-F4C2-4503-9168-85177ED7****

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400InvalidStartTime.MalformedThe Specified parameter "StartTime" is not valid.
400InvalidEndTime.MalformedThe Specified parameter "EndTime" is not valid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-08The Error code has changed. The request parameters of the API has changedView Change Details