Overview
You can call this API to query the metrics of an OceanBase cluster.
API details
Constraints
You have an AccessKey for accessing APIs of multiple clouds. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/services/DescribeMetricsData
Request parameters
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| startTime | string | Yes | The start time of the metrics. The time must be in UTC and in the format of: YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| endTime | string | Yes | The end time of the metrics. The time must be in UTC and in the format of: YYYY-MM-DDThh:mm:ssZ. | 2021-09-13T15:40:43Z |
| metrics | List |
Yes | The name of the metric. | toal_sessions_tenant |
| tenantIdList | List |
No | The list of tenant IDs. | t4tx6u5tc**** |
| nodeIdList | List |
No | The list of node IDs. | i-0104c6fb57e6e**** |
| labels | string | Yes | A string that consists of key-value pairs. The key and value are separated by : and the key-value pairs are separated by ,. For example: "app:OB,clusterId:ob*****,tenantId:t******,serverId:*****,zoneId:cn-hangzhou-j". The key is a fixed field:
|
app:OB,clusterId:ob*** |
| groupByLabels | string | Yes | The fields to be grouped. Multiple fields are separated by commas. For example: "app,clusterId,tenantId". | app,clusterId |
| sortMetricKey | string | No | The column to be sorted. | tps |
| sortOrder | string | No | The sorting order.
|
DESC |
| limit | string | No | The length of the data array to be returned after sorting. | 5 |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| tenantId | string | The tenant ID. | sys |
| data | List | The metric information of the tenant. | [ {"sql_all_count":16.39, "timestamp":1698217920},{"sql_all_count":16.11,"timestamp":1698214980},{"sql_all_count":16.43,"timestamp":1698216900}],"clusterId":"ob568006pe74kg"}, ...... ] |
Examples
Request example
curl --digest -u 'AccessKeyID:AccessKeySecret' \
--request POST \
--url https://api-cloud.oceanbase.com/api/v2/services/DescribeMetricsData\
-H 'X-Ob-Project-Id: <Project ID>'
--data \
'{"InstanceId":"obmt5344s5grrpcw","StartTime":"2023-10-24T20:51:40Z","EndTime":"2023-10-25T02:51:40Z","Metrics":"sql_all_rt,sql_delete_rt,sql_insert_rt,sql_other_rt,sql_replace_rt,sql_select_rt,sql_update_rt","Labels":"clusterId:obmt5344s5grrpcw,tenantId:obmt5344s5grrpcw","GroupByLabels":"clusterId,tenantId"}'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
JSON format
{
"Code":200,
"Cost":91,
"Data":[
{
"tenantId":"sys",
"Data":[
{
"sql_all_count":16.39,
"timestamp":1698217920
},
{
"sql_all_count":16.11,
"timestamp":1698214980
},
{
"sql_all_count":16.43,
"timestamp":1698216900
}
],
"clusterId":"ob****06pe74kg"
},
{
"tenantId":"t****h898auo0",
"Data":[
{
"sql_all_count":0.0,
"timestamp":1698217920
},
{
"sql_all_count":0.0,
"timestamp":1698214980
},
{
"sql_all_count":0.0,
"timestamp":1698216900
}
],
"clusterId":"ob****06pe74kg"
}
],
"Deletable":false,
"ErrorCode":"",
"Message":"successful",
"RequestId":"",
"Success":true,
"Trace":"6F95****-2961-4CEB-****-717E22A5****"
}
Cluster monitoring metrics
| Metric name | Description | Unit | Supported dimensions |
|---|---|---|---|
| sql_all_count | The number of SQL statements processed per second. | times/s | ClusterId, ServerId |
| sql_delete_count | The number of Delete statements processed per second. | times/s | ClusterId, ServerId |
| sql_insert_count | The number of Insert statements processed per second. | times/s | ClusterId, ServerId |
| sql_replace_count | The number of Replace statements processed per second. | times/s | ClusterId, ServerId |
| sql_select_count | The number of Select statements processed per second. | times/s | ClusterId, ServerId |
| sql_update_count | The number of Update statements processed per second. | times/s | ClusterId, ServerId |
| sql_all_rt | The average processing time of an SQL statement. | ms | ClusterId, ServerId |
| sql_delete_rt | The average processing time of a Delete statement. | ms | ClusterId, ServerId |
| sql_insert_rt | The average processing time of an Insert statement. | ms | ClusterId, ServerId |
| sql_other_rt | The average processing time of other statements, such as DDL, DCL, and DTL statements. | ms | ClusterId, ServerId |
| sql_replace_rt | The average processing time of a Replace statement. | ms | ClusterId, ServerId |
| sql_select_rt | The average processing time of a Select statement. | ms | ClusterId, ServerId |
| sql_update_rt | The average processing time of an Update statement. | ms | ClusterId, ServerId |
| transaction_commit_count | The number of transactions committed per second. | times/s | ClusterId, ServerId |
| transaction_count | The number of transactions processed per second. | times/s | ClusterId, ServerId |
| transaction_rollback_count | The number of transactions rolled back per second. | times/s | ClusterId, ServerId |
| transaction_timeout_count | The number of transactions that time out per second. | times/s | ClusterId, ServerId |
| transaction_commit_rt | The average time consumed in committing a transaction. | ms | ClusterId, ServerId |
| transaction_rollback_rt | The average time consumed in rolling back a transaction. | ms | ClusterId, ServerId |
| transaction_rt | The average processing time of a transaction. | ms | ClusterId, ServerId |
| active_session | The number of active sessions. | - | ClusterId, ServerId |
| all_session | The number of sessions. | - | ClusterId, ServerId |
| request_queue_time | The time consumed in waiting for an SQL statement in the queue. | μs | ClusterId, ServerId |
| trans_commit_log_count | The number of transaction logs committed per second. | times/s | ClusterId, ServerId |
| clog_trans_log_total_size | The size of transaction logs committed per second. | byte | ClusterId, ServerId |
| io_count | The number of I/O operations performed on the SSStore per second. | times/s | ClusterId, ServerId |
| io_read_count | The number of read operations performed on the SSStore per second. | times/s | ClusterId, ServerId |
| io_write_count | The number of write operations performed on the SSStore per second. | times/s | ClusterId, ServerId |
| io_read_rt | The average time consumed in reading data from the SSStore. | μs | ClusterId, ServerId |
| io_rt | The I/O time. | μs | ClusterId, ServerId |
| io_write_rt | The average time consumed in writing data to the SSStore. | μs | ClusterId, ServerId |
| io_read_size | The size of data read from the SSStore per second. | byte | ClusterId, ServerId |
| io_size | The size of data processed by the SSStore per second. | byte | ClusterId, ServerId |
| io_write_size | The size of data written to the SSStore per second. | byte | ClusterId, ServerId |
| transaction_multi_partition_count | The number of distributed transactions per second. | times/s | ClusterId, ServerId |
| transaction_partition_count | The number of transactions per second. | times/s | ClusterId, ServerId |
| transaction_single_partition_count | The number of regular transactions per second. | times/s | ClusterId, ServerId |
| trans_commit_log_sync_rt | The average time consumed in synchronizing transaction logs over the network. | μs | ClusterId, ServerId |
| load1 | The average system load of the last 1 minute. | - | ClusterId, ServerId |
| load15 | The average system load of the last 15 minutes. | - | ClusterId, ServerId |
| load5 | The average system load of the last 5 minutes. | - | ClusterId, ServerId |
| cpu_percent | The CPU utilization. | Percentage (%) | ClusterId, ServerId |
| memory_buffers | The size of the kernel buffer cache. | GiB | ClusterId, ServerId |
| memory_cached | The size of memory used for caching. | GiB | ClusterId, ServerId |
| memory_free | The size of available physical memory. | GiB | ClusterId, ServerId |
| memory_used | The size of physical memory used. | GiB | ClusterId, ServerId |
| io | The average number of I/O operations performed per second. | times/s | ClusterId, ServerId |
| io_read | The number of read operations performed per second. | times/s | ClusterId, ServerId |
| io_write | The number of write operations performed per second. | times/s | ClusterId, ServerId |
| io_read_time | The average time consumed in reading data. | ms | ClusterId, ServerId |
| io_time | The I/O time. | ms | ClusterId, ServerId |
| io_write_time | The average time consumed in writing data. | ms | ClusterId, ServerId |
| io_byte | The average size of data processed per second. | MiB | ClusterId, ServerId |
| io_read_byte | The size of data read in each read operation. | MiB | ClusterId, ServerId |
| io_write_byte | The size of data written in each write operation. | MiB | ClusterId, ServerId |
| net_recv | The amount of data received per second. | MiB | ClusterId, ServerId |
| net_send | The amount of data sent per second. | MiB | ClusterId, ServerId |
| net_throughput | The network throughput. | MiB | ClusterId, ServerId |
| ntp_offset_milliseconds | The NTP clock offset. | ms | ClusterId, ServerId |
| ob_data_disk_percent | The usage of the OB data disk. | Percentage (%) | ClusterId, ServerId |
| ob_clog_disk_percent | The usage of the OB log disk. | Percentage (%) | ClusterId, ServerId |
| ob_data_disk_used_size | The size of the OB data disk. | GiB | ClusterId, ServerId |
| ob_process_exists | The status of the OB process. | - | ClusterId, ServerId |
List of tenant monitoring metrics
| Metric | Description | Unit | Dimensions |
|---|---|---|---|
| sql_all_count | The number of SQL statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_delete_count | The number of Delete statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_insert_count | The number of Insert statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_other_count | The number of other statements, such as DDL, DCL, and DTL statements. | times/s | ClusterId, TenantId, ServerId |
| sql_replace_count | The number of Replace statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_select_count | The number of Select statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_update_count | The number of Update statements processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_all_rt | The average time consumed in processing an SQL statement. | ms | ClusterId, TenantId, ServerId |
| sql_delete_rt | The average time consumed in processing a Delete statement. | ms | ClusterId, TenantId, ServerId |
| sql_insert_rt | The average time consumed in processing an Insert statement. | ms | ClusterId, TenantId, ServerId |
| sql_other_rt | The average time consumed in processing other statements, such as DDL, DCL, and DTL statements. | ms | ClusterId, TenantId, ServerId |
| sql_replace_rt | The average time consumed in processing a Replace statement. | ms | ClusterId, TenantId, ServerId |
| sql_select_rt | The average time consumed in processing a Select statement. | ms | ClusterId, TenantId, ServerId |
| sql_update_rt | The average time consumed in processing an Update statement. | ms | ClusterId, TenantId, ServerId |
| active_session | The number of active sessions. | - | ClusterId, TenantId, ServerId |
| all_session | The number of sessions. | - | ClusterId, TenantId, ServerId |
| sql_distributed_count | The number of distributed execution plans processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_local_count | The number of local executions processed per second. | times/s | ClusterId, TenantId, ServerId |
| sql_remote_count | The number of remote execution plans processed per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_internal_total_waits | The number of internal wait events per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_io_total_waits | The number of I/O wait events per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_latch_total_waits | The number of latch wait events per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_other_total_waits | The number of other wait events per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_row_lock_wait_total_waits | The average lock wait time. | ms | ClusterId, TenantId, ServerId |
| system_event_sync_rpc_total_waits | The average time consumed in synchronous RPC wait events. | ms | ClusterId, TenantId, ServerId |
| wait_event_count | The number of wait events per second. | times/s | ClusterId, TenantId, ServerId |
| system_event_internal_time_waited | The average time consumed in internal wait events. | ms | ClusterId, TenantId, ServerId |
| wait_event_rt | The average time consumed in wait events. | ms | ClusterId, TenantId, ServerId |
| request_dequeue_count | The number of requests dequeued from the processing queue. | times/s | ClusterId, TenantId, ServerId |
| request_enqueue_count | The number of requests enqueued into the processing queue. | times/s | ClusterId, TenantId, ServerId |
| request_queue_time | The time consumed in waiting for an SQL statement in the queue. | μs | ClusterId, TenantId, ServerId |
| ob_cpu_percent | CPU utilization. | Percentage (%) | ClusterId, TenantId, ServerId |
| memstore_percent | The percentage of MEMStore usage. | Percentage (%) | ClusterId, TenantId, ServerId |
| rpc_packet_in_rt | The average time consumed in receiving an RPC packet. | μs | ClusterId, TenantId, ServerId |
| rpc_packet_out_rt | The average time consumed in sending an RPC packet. | μs | ClusterId, TenantId, ServerId |
| rpc_packet_in | The throughput of receiving an RPC packet. | byte | ClusterId, TenantId, ServerId |
| rpc_packet_out | The throughput of sending an RPC packet. | byte | ClusterId, TenantId, ServerId |
| opened_cursors_count | The number of open cursors. | times/s | ClusterId, TenantId, ServerId |
| transaction_commit_count | The number of committed transactions per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_count | The number of transactions processed per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_rollback_count | The number of rolled-back transactions per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_timeout_count | The number of timed-out transactions per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_commit_rt | The average time consumed in committing a transaction. | ms | ClusterId, TenantId, ServerId |
| transaction_rollback_rt | The average time consumed in rolling back a transaction. | ms | ClusterId, TenantId, ServerId |
| transaction_rt | Average transaction processing time | ms | ClusterId, TenantId, ServerId |
| trans_commit_log_count | Number of transaction logs committed per second | times/s | ClusterId, TenantId, ServerId |
| clog_trans_log_total_size | Size of transaction logs committed per second | byte | ClusterId, TenantId, ServerId |
| memstore_write_lock_fail_count | Number of write lock wait failures per second | times/s | ClusterId, TenantId, ServerId |
| memstore_write_lock_succ_count | Number of successful write lock waits per second | times/s | ClusterId, TenantId, ServerId |
| memstore_write_lock_wait_time | Average write lock wait time | μs | ClusterId, TenantId, ServerId |
| transaction_multi_partition_count | Number of distributed transactions per second | times/s | ClusterId, TenantId, ServerId |
| transaction_single_partition_count | Number of regular transactions per second | times/s | ClusterId, TenantId, ServerId |
| trans_commit_log_sync_rt | Average network synchronization time for transaction logs | μs | ClusterId, TenantId, ServerId |
| active_memstore_used | Size of active MEMStore | MiB | ClusterId, TenantId, ServerId |
| major_freeze_trigger | Major freeze trigger threshold | MiB | ClusterId, TenantId, ServerId |
| memstore_limit | Limit of MEMStore | MiB | ClusterId, TenantId, ServerId |
| total_memstore_used | Total size of MEMStore | MiB | ClusterId, TenantId, ServerId |
| io_read_count | Number of reads from SSStore per second | times/s | ClusterId, TenantId, ServerId |
| io_write_count | Number of writes to SSStore per second | times/s | ClusterId, TenantId, ServerId |
| io_read_rt | Average read time from SSStore | μs | ClusterId, TenantId, ServerId |
| io_write_rt | Average write time to SSStore | μs | ClusterId, TenantId, ServerId |
| io_read_size | Size of data read from SSStore per second | byte | ClusterId, TenantId, ServerId |
| io_write_size | Size of data written to SSStore per second | byte | ClusterId, TenantId, ServerId |
| bloom_filter_cache_size | Size of bloom filter cache | MiB | ClusterId, TenantId, ServerId |
| clog_cache_size | Size of Clog cache | MiB | ClusterId, TenantId, ServerId |
| location_cache_size | Size of location cache | MiB | ClusterId, TenantId, ServerId |
| plan_cache_size | Size of execution plan cache | MiB | ClusterId, TenantId, ServerId |
| row_cache_size | Size of row cache | MiB | ClusterId, TenantId, ServerId |
| block_cache_hit_ratio | Block cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| bloom_filter_cache_hit_ratio | Bloom filter cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| clog_cache_hit_ratio | Clog cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| location_cache_hit_ratio | Location cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| plan_cache_hit_ratio | Execution plan cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| row_cache_hit_ratio | Row cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| block_cache_req_total | Number of block cache requests per second | times/s | ClusterId, TenantId, ServerId |
| bloom_filter_cache_req_total | Number of bloom filter cache requests per second | times/s | ClusterId, TenantId, ServerId |
| clog_cache_req_total | Number of Clog cache requests per second | times/s | ClusterId, TenantId, ServerId |
| location_cache_req_total | Number of location cache requests per second | times/s | ClusterId, TenantId, ServerId |
| row_cache_req_total | Number of row cache requests per second | times/s | ClusterId, TenantId, ServerId |
| ob_tenant_binlog_disk_used | Size of binlog disk space used | GiB | ClusterId, TenantId, ServerId |