Overview
You can call this API to query the single- or multi-dimensional metrics of an OceanBase cluster.
API details
Constraints
The caller must have an AccessKey for accessing the APIs of OceanBase Cloud. 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 instance. | 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 contains 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 keys are fixed.
|
app:OB,clusterId:ob*** |
| groupByLabels | string | Yes | The fields for grouping. Separate multiple fields with commas. For example: "app,clusterId,tenantId". | app,clusterId |
| sortMetricKey | string | No | The column for sorting. | tps |
| sortOrder | string | No | The sorting rule.
|
DESC |
| limit | string | No | The length of the data array returned after sorting. | 5 |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| tenantId | string | The ID of the tenant. | sys |
| data | List | The metrics 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****"
}
List of 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 time consumed in processing SQL statements. | ms | ClusterId, ServerId |
| sql_delete_rt | The average time consumed in processing Delete statements. | ms | ClusterId, ServerId |
| sql_insert_rt | The average time consumed in processing Insert statements. | ms | ClusterId, ServerId |
| sql_other_rt | The average time consumed in processing other statements such as DDL, DCL, and DTL statements. | ms | ClusterId, ServerId |
| sql_replace_rt | The average time consumed in processing Replace statements. | ms | ClusterId, ServerId |
| sql_select_rt | The average time consumed in processing Select statements. | ms | ClusterId, ServerId |
| sql_update_rt | The average time consumed in processing Update statements. | 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 timed 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 time consumed in processing 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 SSStore per second. | times/s | ClusterId, ServerId |
| io_read_count | The number of read operations performed on SSStore per second. | times/s | ClusterId, ServerId |
| io_write_count | The number of write operations performed on SSStore per second. | times/s | ClusterId, ServerId |
| io_read_rt | The average time consumed in reading data from SSStore. | μs | ClusterId, ServerId |
| io_rt | The I/O time. | μs | ClusterId, ServerId |
| io_write_rt | The average time consumed in writing data to SSStore. | μs | ClusterId, ServerId |
| io_read_size | The amount of data read from SSStore per second. | byte | ClusterId, ServerId |
| io_size | The amount of data processed by SSStore per second. | byte | ClusterId, ServerId |
| io_write_size | The amount of data written to 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 ordinary 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 load of the system over the last 1 minute. | - | ClusterId, ServerId |
| load15 | The average load of the system over the last 15 minutes. | - | ClusterId, ServerId |
| load5 | The average load of the system over the last 5 minutes. | - | ClusterId, ServerId |
| cpu_percent | The CPU usage. | 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 amount of data processed per second. | MiB | ClusterId, ServerId |
| io_read_byte | The amount of data read each time. | MiB | ClusterId, ServerId |
| io_write_byte | The amount of data written each time. | 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 |
Supported metrics for tenant monitoring
| Metric Name | 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 processed per second. | 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 processing time of SQL statements. | ms | ClusterId, TenantId, ServerId |
| sql_delete_rt | The average processing time of Delete statements. | ms | ClusterId, TenantId, ServerId |
| sql_insert_rt | The average processing time of Insert statements. | ms | ClusterId, TenantId, ServerId |
| sql_other_rt | The average processing time of other statements such as DDL, DCL, and DTL statements. | ms | ClusterId, TenantId, ServerId |
| sql_replace_rt | The average processing time of Replace statements. | ms | ClusterId, TenantId, ServerId |
| sql_select_rt | The average processing time of Select statements. | ms | ClusterId, TenantId, ServerId |
| sql_update_rt | The average processing time of Update statements. | 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 synchronous RPC wait time. | 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 internal wait time. | ms | ClusterId, TenantId, ServerId |
| wait_event_rt | The average wait time. | ms | ClusterId, TenantId, ServerId |
| request_dequeue_count | The number of requests dequeued from the processing queue per second. | times/s | ClusterId, TenantId, ServerId |
| request_enqueue_count | The number of requests enqueued into the processing queue per second. | times/s | ClusterId, TenantId, ServerId |
| request_queue_time | The average waiting time of SQL statements in the waiting queue. | μs | ClusterId, TenantId, ServerId |
| ob_cpu_percent | The CPU utilization. | Percentage (%) | ClusterId, TenantId, ServerId |
| memstore_percent | The percentage of MEMStore usage. | Percentage (%) | ClusterId, TenantId, ServerId |
| rpc_packet_in_rt | The average time taken to receive an RPC packet. | μs | ClusterId, TenantId, ServerId |
| rpc_packet_out_rt | The average time taken to send an RPC packet. | μs | ClusterId, TenantId, ServerId |
| rpc_packet_in | The throughput of receiving RPC packets. | byte | ClusterId, TenantId, ServerId |
| rpc_packet_out | The throughput of sending RPC packets. | byte | ClusterId, TenantId, ServerId |
| opened_cursors_count | The number of open cursors. | times/s | ClusterId, TenantId, ServerId |
| transaction_commit_count | The number of transactions committed 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 transactions rolled back per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_timeout_count | The number of transactions that time out per second. | times/s | ClusterId, TenantId, ServerId |
| transaction_commit_rt | The average transaction commit time. | ms | ClusterId, TenantId, ServerId |
| transaction_rollback_rt | The average transaction rollback time. | ms | ClusterId, TenantId, ServerId |
| transaction_rt | The average transaction processing time | ms | ClusterId, TenantId, ServerId |
| trans_commit_log_count | The number of transaction logs committed per second | times/s | ClusterId, TenantId, ServerId |
| clog_trans_log_total_size | The size of transaction logs committed per second | byte | ClusterId, TenantId, ServerId |
| memstore_write_lock_fail_count | The number of write lock wait failures per second | times/s | ClusterId, TenantId, ServerId |
| memstore_write_lock_succ_count | The number of write lock wait successes per second | times/s | ClusterId, TenantId, ServerId |
| memstore_write_lock_wait_time | The average write lock wait time | μs | ClusterId, TenantId, ServerId |
| transaction_multi_partition_count | The number of distributed transactions per second | times/s | ClusterId, TenantId, ServerId |
| transaction_single_partition_count | The number of normal transactions per second | times/s | ClusterId, TenantId, ServerId |
| trans_commit_log_sync_rt | The average time for each transaction log network synchronization | μs | ClusterId, TenantId, ServerId |
| active_memstore_used | The size of the active MEMStore | MiB | ClusterId, TenantId, ServerId |
| major_freeze_trigger | The major freeze trigger threshold | MiB | ClusterId, TenantId, ServerId |
| memstore_limit | The limit of the MEMStore | MiB | ClusterId, TenantId, ServerId |
| total_memstore_used | The total size of the MEMStore | MiB | ClusterId, TenantId, ServerId |
| io_read_count | The number of SSStore reads per second | times/s | ClusterId, TenantId, ServerId |
| io_write_count | The number of SSStore writes per second | times/s | ClusterId, TenantId, ServerId |
| io_read_rt | The average read time for each SSStore read | μs | ClusterId, TenantId, ServerId |
| io_write_rt | The average write time for each SSStore write | μs | ClusterId, TenantId, ServerId |
| io_read_size | The size of data read from the SSStore per second | byte | ClusterId, TenantId, ServerId |
| io_write_size | The size of data written to the SSStore per second | byte | ClusterId, TenantId, ServerId |
| bloom_filter_cache_size | The size of the bloom filter cache | MiB | ClusterId, TenantId, ServerId |
| clog_cache_size | The size of the Clog cache | MiB | ClusterId, TenantId, ServerId |
| location_cache_size | The size of the location cache | MiB | ClusterId, TenantId, ServerId |
| plan_cache_size | The size of the execution plan cache | MiB | ClusterId, TenantId, ServerId |
| row_cache_size | The size of the row cache | MiB | ClusterId, TenantId, ServerId |
| block_cache_hit_ratio | The block cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| bloom_filter_cache_hit_ratio | The bloom filter cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| clog_cache_hit_ratio | The Clog cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| location_cache_hit_ratio | The location cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| plan_cache_hit_ratio | The execution plan cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| row_cache_hit_ratio | The row cache hit rate | Percentage (%) | ClusterId, TenantId, ServerId |
| block_cache_req_total | The number of block cache requests per second | times/s | ClusterId, TenantId, ServerId |
| bloom_filter_cache_req_total | The number of bloom filter cache requests per second | times/s | ClusterId, TenantId, ServerId |
| clog_cache_req_total | The number of Clog cache requests per second | times/s | ClusterId, TenantId, ServerId |
| location_cache_req_total | The number of location cache requests per second | times/s | ClusterId, TenantId, ServerId |
| row_cache_req_total | The number of row cache requests per second | times/s | ClusterId, TenantId, ServerId |
| ob_tenant_binlog_disk_used | The size of the binlog disk used | GiB | ClusterId, TenantId, ServerId |
