In addition to a log system, OceanBase Database Proxy (ODP) also provides monitoring data for integration with different monitoring platforms through Prometheus.
Related parameters
You can configure the following parameters in ODP to manage and adjust the Prometheus monitoring feature.
| Parameter | Description |
|---|---|
| prometheus_listen_port | The Prometheus listening port of ODP. Default value: 2884. |
| prometheus_cost_ms_unit | Specifies whether to convert the calculation unit of Prometheus to milliseconds. The default unit is microseconds. If you set this parameter to true, the time unit of monitoring data changes to milliseconds. |
| prometheus_sync_interval | The time interval for refreshing Prometheus monitoring data. Default value: 1 min. |
| enable_prometheus | Specifies whether to enable Prometheus monitoring. Default value: true. |
| enable_extra_prometheus_metric | Specifies whether to enable other metrics. Default value: false. Recommended value for a test environment: true. |
After you correctly configure related Prometheus parameters, namely, retain the default values for the parameters except enable_extra_prometheus_metric, start ODP, connect to the OceanBase cluster through ODP, and execute several SQL statements. You can run the curl "http://127.1:2884/metrics" command to view related monitoring data of Prometheus.
Basic metrics
| Metric | Description | Tag | Remarks |
|---|---|---|---|
| odp_transaction_total | The number of transactions that have been executed. The value monotonically increments. | cluster, tenant, schema | None |
| odp_sql_request_total | The number of SQL statements that have been executed. The value monotonically increments. | cluster, tenant, schema, slowQuery, sqlResult, sqlType, partitionHit | sqlResult indicates the execution result and has two valid values: "fail" and "success". ODP provides a new tag partitionHit in V4.3.0 and later to indicate whether routing is accurate. The tag has two valid values: "true" and "false". In ODP V4.3.0 and later, the odp_sql_request_total metric supports the sqlType tag in the public cloud. This tag has the following valid values: select, update, insert, delete, and other. |
| odp_current_session | The current number of connections of ODP, including client connections to ODP and ODP connections to the OBServer node. The value does not monotonically increment. | cluster, tenant, schema, sessionType, vip | sessionType has two valid values: "client" and "server", which respectively record the number of connections between the client and ODP and that between ODP and the OBServer node. ODP provides a new tag vip in V4.3.0 and later to indicate the client VIP.
NoteThis metric does not record the number of connections of the |
| odp_new_client_connections | The number of client connections with login attempts to ODP. The value monotonically increments. | cluster, tenant, vip, ConnectionResult | This metric was introduced in ODP V4.3.0. ODP provides a new tag ConnectionResult in V4.3.0 BP1 and later to indicate whether the login is successful. The tag has two valid values: "fail" and "success".
NoteThis metric does not record the number of connections of the |
| odp_sql_cost_total | The time consumed to execute the current SQL query. The value monotonically increments. | cluster, tenant, schema, timeType, sqlType | timeType has three valid values:
odp_sql_cost_total metric supports the sqlType tag in a public cloud. This tag has the following valid values: select, update, insert, delete, and other. |
| odp_memory | The memory information about ODP. | memType | memType has two valid values:
|
Extra metrics
By default, the metrics listed in the following table do not have data. They provide data only when enable_extra_prometheus_metric is set to true.
| Metric | Description | Tag | Remarks |
|---|---|---|---|
| odp_request_byte | The number of bytes transmitted between the client and ODP and between ODP and the OBServer node. The value monotonically increments. | cluster, tenant, schema, sessionType, transType | sessionType has two valid values: "client" and "server", which respectively record the number of bytes transmitted between the client and ODP and that between ODP and the OBServer node. transType has two valid values: "request" and "response", which respectively indicate request data and response data. sessionType can be used in combination with transType to represent four types of byte flows.
NoteThis metric exists only in a private cloud environment. |
| odp_entry_total | The number of times that ODP searches for table_entry and partition_entry. |
cluster, tenant, schema, entryType, routeHit, routeResult | entryType has three valid values: "table_entry", "partition_info", and "partition_entry". routeHit has two valid values: "true" and "false". The value "true" indicates that the information is obtained from the local cache. routeResult has two valid values: "true" and "false". The value "true" indicates that the information is successfully obtained. |