Expressions of OCP metrics
An expression of OceanBase Cloud Platform (OCP) is a template in a PromQL-like syntax. Expressions are used to calculate the sequential data of the corresponding collection items. Here are some examples.
| Metric | Expression |
|---|---|
| qps | sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS) |
| qps_rt | sum(rate(ob_sysstat{stat_id="40001",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS) |
@LABELS, @INTERVAL, and @GBLABELS are wildcards that can be replaced with actual query conditions as needed. For example, you can replace the wildcards in the avg(rate(node_cpu_seconds_total_native{mode="idle",@LABELS}[@INTERVAL])) by (@GBLABELS) expression based on the actual conditions as follows:
100 * avg(rate(node_cpu_seconds_total_native{mode="idle",svr_ip="xxx.xxx.xxx.1"}[1])) by (svr_ip)
100 * avg(rate(node_cpu_seconds_total_native{mode="idle",svr_ip="xxx.xxx.xxx.2"}[1])) by (svr_ip)
100 * avg(rate(node_cpu_seconds_total_native{mode="idle",svr_ip="xxx.xxx.xxx.3"}[1])) by (svr_ip)
Wildcards
| Wildcard | Description |
|---|---|
| @LABELS | The label for filtering. It can be replaced with actual conditions such as ob_cluster_id="1" and svr_ip="xxx.xxx.xxx.xxx". |
| @INTERVAL | The range vector selector for range queries in PromQL. It can be used by only functions such as rate() and delta(). |
| @GBLABELS | The dimension based on which aggregation is performed. It can be replaced with actual conditions such as ob_cluster_id and svr_ip, and is similar to the GROUP BY clause in the SQL syntax. |
The sum(metric{@LABELS}) by (@GBLABELS) expression, for example, specifies to aggregate the metrics based on the GBLABELS condition to obtain the sum.
The following table describes general Prometheus functions supported by expressions in OCP:
| Function | Description |
|---|---|
| abs | Returns the absolute value of values provided. |
| sum | Returns the sum of values provided. |
| avg | Returns the average value of values provided. |
| min | Returns the minimum value among values provided. |
| max | Returns the maximum value among values provided. |
| count | Returns the count of values. |
| rate | Returns the average growth rate per second. |
| delta | Returns the difference between the first and last values of time-series elements. |
| round | Returns the integer that is nearest to the value provided. |
Default collection items of OCP V4.2.x
Hosts
| Collection item name | Description | Feature | Object dimension | Unit |
|---|---|---|---|---|
| node_cpu_seconds_total | The CPU time spent in each mode. | COUNTER | HOST | s |
| node_cpu_seconds_total_native | The time spent in each mode by each CPU core. | COUNTER | HOST | s |
| node_disk_io_time_weighted_seconds_total | The weighted time spent performing I/O operations on disk partitions. | COUNTER | HOST | s |
| node_disk_read_bytes_total | The total amount of data read from the disk. | COUNTER | HOST | Bytes |
| node_disk_read_time_seconds_total | The time spent on disk reads. | COUNTER | HOST | s |
| node_disk_reads_completed_total | The number of successful disk reads. | COUNTER | HOST | - |
| node_disk_write_time_seconds_total | The time spent on disk writes. | COUNTER | HOST | s |
| node_disk_writes_completed_total | The number of successful disk writes. | COUNTER | HOST | - |
| node_disk_written_bytes_total | The total amount of data written to the disk. | COUNTER | HOST | Bytes |
| node_filesystem_avail_bytes | The available space of the file system. | GAUGE | HOST | Bytes |
| node_filesystem_files | The number of inodes of the mounted file system. | GAUGE | HOST | - |
| node_filesystem_files_free | The number of idle inodes of the mounted file system. | GAUGE | HOST | - |
| node_filesystem_readonly | The size of the mounted read-only file system. | GAUGE | HOST | Bytes |
| node_filesystem_size_bytes | The size of the mounted file system. | GAUGE | HOST | Bytes |
| node_load1 | The average CPU load of the system in the last 1 minute. | GAUGE | HOST | - |
| node_load5 | The average CPU load of the system in the last 5 minutes. | GAUGE | HOST | - |
| node_load15 | The average CPU load of the system in the last 15 minutes. | GAUGE | HOST | - |
| node_memory_Buffers_bytes | The size of the buffer memory. | GAUGE | HOST | Bytes |
| node_memory_Cached_bytes | The size of the cache memory. | GAUGE | HOST | Bytes |
| node_memory_MemFree_bytes | The size of idle memory. | GAUGE | HOST | Bytes |
| node_memory_MemTotal_bytes | The total memory size. | GAUGE | HOST | Bytes |
| node_network_receive_bytes_total | The total amount of data received by the network interface card (NIC). | COUNTER | HOST | Bytes |
| node_network_receive_drop_total | The amount of data dropped by the NIC on reception. | COUNTER | HOST | Bytes |
| node_network_receive_errs_total | The amount of data that causes errors when it is received by the NIC. | COUNTER | HOST | Bytes |
| node_network_transmit_bytes_total | The total amount of data sent by the NIC. | COUNTER | HOST | Bytes |
| node_network_transmit_drop_total | The amount of data dropped by the NIC on sending. | COUNTER | HOST | Bytes |
| node_network_transmit_errs_total | The amount of data that causes errors when it is sent by the NIC. | COUNTER | HOST | Bytes |
| cpu_count | The number of CPU cores. | GAUGE | HOST | - |
| io_await | The average duration of disk I/O operations. | GAUGE | HOST | ms |
| io_util | The disk I/O usage. | GAUGE | HOST | % |
| node_net_bandwidth_bps | The NIC rate. | GAUGE | HOST | bps |
| node_ntp_offset_seconds | The latency of the Network Time Protocol (NPT) service. | GAUGE | HOST | s |
| process_exists | Indicates whether the process exists. Valid values: |
GAUGE | HOST | - |
| tcp_retrans | The TCP retransmission rate. | GAUGE | HOST | % |
OceanBase Database
| Collection item name | Description | Feature | Object dimension | Unit |
|---|---|---|---|---|
| ob_sysstat | The statistical metric of OceanBase Database. | OCEANBASE | - | |
| ob_session_active_num | The number of active connections. | GAUGE | OCEANBASE | - |
| ob_session_all_num | The total number of connections. | GAUGE | OCEANBASE | - |
| ob_server_stopped_duration_seconds | The duration when the OBServer node stops. | GAUGE | OCEANBASE | s |
| ob_zone_stat | The status of the zone. | GAUGE | OCEANBASE | - |
| ob_zone_current_timestamp | The current time of the zone. | GAUGE | OCEANBASE | μs |
| ob_cache_size_bytes | The size of the KV cache. | GAUGE | OCEANBASE | Bytes |
| ob_partition_num | The number of partitions. | GAUGE | OCEANBASE | - |
| ob_server_num | The number of OBServer nodes. | GAUGE | OCEANBASE | - |
| ob_plan_cache_access_total | The number of visits to the execution plan. | COUNTER | OCEANBASE | - |
| ob_plan_cache_hit_total | The number of execution plan hits. | COUNTER | OCEANBASE | - |
| ob_plan_cache_memory_bytes | The size of the plan cache. | GAUGE | OCEANBASE | Bytes |
| ob_table_num | The number of tables. | GAUGE | OCEANBASE | - |
| ob_waitevent_wait_seconds_total | The total time spent on waiting for events. | COUNTER | OCEANBASE | s |
| ob_waitevent_wait_total | The total number of waits for events. | COUNTER | OCEANBASE | - |
| ob_system_event_total_waits | The total number of waits for the event. | COUNTER | OCEANBASE | - |
| ob_system_event_time_waited | The total time spent on waiting for the event. | COUNTER | OCEANBASE | s |
OBProxy
| Collection item name | Description | Feature | Object dimension | Unit |
|---|---|---|---|---|
| odp_transaction_total | The total number of transactions. | COUNTER | OBPROXY | - |
| odp_sql_request_total | The total number of requests. | COUNTER | OBPROXY | - |
| odp_sql_cost_total | The total execution time of requests. | COUNTER | OBPROXY | μs |
| odp_current_session | The current number of sessions. | COUNTER | OBPROXY | - |
| odp_entry_total | The number of table entry requests. | COUNTER | OBPROXY | - |
| odp_request_byte | The number of bytes in the request. | COUNTER | OBPROXY | Byte |