When OceanBase Database Proxy (ODP) is running, ODP sends request information and error information to corresponding log files. You can perform targeted analysis based on the log files. In addition, OceanBase Cloud Platform (OCP) provides rich monitoring information about ODP.
obproxy_digest.log file
If the value of the query_digest_time_threshold parameter for a request exceeds the threshold or an error response is returned for the request, the request information is sent to the obproxy_digest.log file. The default value of query_digest_time_threshold is 100 and that for the primary site is 2, in milliseconds.
Note
query_digest_time_threshold specifies the threshold of request execution duration. If the execution duration exceeds the threshold, a log is recorded in the query_digest_time_threshold file. For more information about this parameter, see Dynamically modifiable parameters of ODP.
Sample logs
2020-03-18 21:26:54.871053,postmen,,,,postmen40:postmen_new0497_3279:postmen_r497,OB_MYSQL,,postmen_push_msg_4977,COM_QUERY,SELECT,success,,SELECT id%2C gmt_create%2C gmt_modified%2C msg_id%2C principal_id%2C app_name%2C target_utdid%2C biz_id%2C host%2C status%2C expire_time%2C msg_data FROM postmen_push_msg_4977 WHERE principal_id = 'W/jEKoLOxnwDABWmhzjgmK1V' AND app_name = 'KOUBEI' AND expire_time > 1584538014858 AND status = 1,11765us,52us,0us,11632us,Y0-7F16DD5BEBC0,,
2020-03-18 21:26:54.871053,xxx,0a0fe91c1514974353459100919649,0.1,,cluster:tenant:database,OB_MYSQL,test,test_99,COM_QUERY,SELECT,success,,select * from test_99,11765us,52us,0us,11632us,Y0-7F16DD5BEBC0,,
Log information description
The sample logs contain the following information in sequence:
Log generation time
Name of the current application
Trace ID
RPC ID
Logical data source name, which is left empty in ODP V1.x
Physical database information, in the format of Cluster:Tenant:Database
Database type, which can be OB or RDS
Logical table name, which is left empty in ODP V1.x
Physical table name
SQL command, such as
COM_QUERYorCOM_STMT_PREPARESQL type, such as
CREATE,READ,UPDATE, orDELETE(CRUD)Execution result, which can be success or failed
Error code, which is left empty when the execution result is success
SQL statement
Total execution duration in milliseconds, including the internal SQL execution duration
Pre-execution duration
Connection establishment duration
Database execution duration
Current thread name, which is the internal thread ID of ODP
System penetration data, such as system disaster recovery information
Penetration data
DBKey name (supported in OceanBase Database V2.0.20 and later)
Whether BeyondTrust is used (supported in OceanBase Database V2.0.20 and later). The value
1indicates that BeyondTrust is used. The value0indicates that BeyondTrust is not used.IP address of the backend OBServer node
obproxy_stat.log file
The obproxy_stat.log file records ODP request statistical logs. One log is generated every minute. Sample logs
2020-03-18 21:26:59.504487,postmen,,postmen50:postmen_new0563_3279:postmen_r563,OB_MYSQL,SELECT,success,,1,0,0,0,9.383ms,0.029ms,9.263ms
2020-03-18 21:26:59.504509,postmen,,postmen50:postmen_new0528_3279:postmen_r528,OB_MYSQL,SHOW,success,,2,0,0,0,14.280ms,0.056ms,14.067ms
2020-03-18 21:26:59.504545,postmen,,postmen30:postmen_new0363_3279:postmen_r363,OB_MYSQL,SELECT,success,,5,0,0,0,0.158ms,0.000ms,0.000ms
2020-03-18 21:26:59.504563,postmen,,postmen50:postmen_new0561_3279:postmen_r561,OB_MYSQL,SELECT,failed,1054,1,0,0,0,8.487ms,0.048ms,8.281ms
2020-03-18 21:26:59.504604,postmen,,postmen50:postmen_new0561_3279:postmen_r561,OB_MYSQL,OTHERS,success,,1,0,0,0,27.148ms,17.902ms,9.102ms
2020-03-18 21:26:59.504487,xxx,,cluster:tenant:database,OB_MYSQL,SELECT,success,,1,0,0,0,9.383ms,0.029ms,9.263ms
2020-03-18 21:26:59.504509,xxx,,cluster:tenant:database,OB_MYSQL,SHOW,success,,2,0,0,0,14.280ms,0.056ms,14.067ms
2020-03-18 21:26:59.504545,xxx,,cluster:tenant:database,OB_MYSQL,SELECT,success,,5,0,0,0,0.158ms,0.000ms,0.000ms
2020-03-18 21:26:59.504563,xxx,,cluster:tenant:database,OB_MYSQL,SELECT,failed,1054,1,0,0,0,8.487ms,0.048ms,8.281ms
2020-03-18 21:26:59.504604,xxx,,cluster:tenant:database,OB_MYSQL,OTHERS,success,,1,0,0,0,27.148ms,17.902ms,9.102ms
Log information description
The sample logs contain the following information in sequence:
Log generation time
Name of the current application
Logical data source name, which is left empty in ODP V1.x
Physical database information, in the format of Cluster:Tenant:Database
Database type, which can be OB or RDS
SQL type, such as
CREATE,READ,UPDATE, orDELETE(CRUD)Execution result, which can be success or failed
Error code, which is left empty when the execution result is success
Total number of requests
Number of requests whose execution duration is from 30 ms to 100 ms
Number of requests whose execution duration is from 100 ms to 500 ms
Number of requests whose execution duration exceeds 500 ms
Total execution duration in milliseconds, including the internal SQL execution duration
Pre-execution duration
Database execution duration
obproxy_slow.log file
If the value of the slow_query_time_threshold parameter for a request exceeds the threshold, the request information is sent to the obproxy_slow.log file. The default value of query_digest_time_threshold is 500, in milliseconds.
Note
slow_query_time_threshold specifies the execution duration threshold of slow requests. If the execution duration of a request exceeds the threshold, a log is recorded in the obproxy_slow.log file. For more information about this parameter, see Dynamically modifiable parameters of ODP.
Sample logs
2020-03-16 21:31:32.125967,postmen,,,,postmen20:postmen_new0200_3279:postmen_r200,OB_MYSQL,,,COM_LOGIN,,success,,,507680us,507049us,0us,515us,Y0-7F16DD5743A0,,
2020-03-16 21:31:49.561865,postmen,,,,postmen50:postmen_new0580_3279:postmen_r580,OB_MYSQL,,,COM_LOGIN,,success,,,1258599us,1249321us,0us,9130us,Y0-7F16DB9752C0,,
2020-03-16 21:31:32.125967,xxx,0a0fe91c1514974353459100919649,0.1,,cluster:tenant:database,OB_MYSQL,,,COM_LOGIN,,success,,,507680us,507049us,0us,515us,Y0-7F16DD5743A0,,
2020-03-16 21:31:49.561865,xxx,0a0fe91c1514974353459100919649,0.1,,cluster:tenant:database,OB_MYSQL,,,COM_LOGIN,,success,,,1258599us,1249321us,0us,9130us,Y0-7F16DB9752C0,,
Log information description
The sample logs contain the following information in sequence:
Log generation time
Name of the current application
Trace ID
RPC ID
Logical data source name, which is left empty in ODP V1.x
Physical database information, in the format of Cluster:Tenant:Database
Database type, which can be OB or RDS
Logical table name, which is left empty in ODP V1.x
Physical table name
SQL command, such as
COM_QUERYorCOM_STMT_PREPARESQL type, such as
CREATE,READ,UPDATE, orDELETE(CRUD)Execution result, which can be success or failed
Error code, which is left empty when the execution result is success
SQL statement
Total execution duration in milliseconds, including the internal SQL execution duration
Pre-execution duration
Connection establishment duration
Database execution duration
Current thread name, which is the internal thread ID of ODP
System penetration data, such as system disaster recovery information
Penetration data
DBKey name (supported in OceanBase Database V2.0.20 and later)
Whether BeyondTrust is used (supported in OceanBase Database V2.0.20 and later). The value
1indicates that BeyondTrust is used. The value0indicates that BeyondTrust is not used.IP address of the backend OBServer node
obproxy_error.log file
If an error occurs for a request, the error information is sent to the obproxy_error.log file, including the information about the ODP error and the error returned by the relevant OBServer node.
Sample logs
2020-03-18 21:28:10.497945,postmen,,,,postmen70:postmen_new0781_3279:postmen_r781,OB_MYSQL,,postmen_connection_info_7819,COM_QUERY,INSERT,failed,1054,INSERT INTO postmen_connection_info_7819 ( gmt_create%2C gmt_modified%2C app_name%2C principal_id%2C utdid%2C link_info_key%2C product_id%2C product_version%2C os_type%2C os_version%2C network%2C brand%2C model%2C last_active_time%2C status%2C ext_attr%2C worker_id%2C sid%2C postmen_ip%2C link_version%2C protocol_type%2C zone_name%2C sync_version%2C background_time%2C app_status%2C device_id%2C push_switch ) VALUES ( now(6)%2C now(6)%2C 'KOUBEI'%2C '2088212505319787'%2C 'W/jEKoLOxnwDABWmhzjgmK1V'%2C '11.233.24.240_3883D71A4ECCAE0F_AB18'%2C 'KOUBEI_APP_ANDROID'%2C '7.1.87.000001'%2C 'android'%2C '9'%2C 'wifi'%2C 'xiaomi'%2C 'MI 8 SE'%2C 1584538090493%2C 1%2C null%2C '11.233.24.240_3883D71A4ECCAE0F'%2C 43800%2C '11.235.166.113'%2C 1%2C 'MMTP'%2C 'RZ99S'%2C 6%2C 1584538090477%2C 1%2C 'W/jEKoLOxnwDABWmhzjgmK1V'%2C '1' ) ON DUPLICATE KEY UPDATE gmt_modified = now(6)%2C utdid = 'W/jEKoLOxnwDABWmhzjgmK1V'%2C link_info_key = '11.233.24.240_3883D71A4ECCAE0F_AB18'%2C product_id = 'KO,1138us,29us,0us,984us,Y0-7F16DD5BDF00,,,Unknown column 'push_switch' in 'field list'
2020-03-18 21:28:10.497945,xxx,0a0fe91c1514974353459100919649,0.1,,cluster:tenant:database,OB_MYSQL,test,test_99,COM_QUERY,INSERT,failed,1054,INSERT INTO test_99 (push_switch ) VALUES ( '1' ) ,1138us,29us,0us,984us,Y0-7F16DD5BDF00,,,Unknown column 'push_switch' in 'field list'
Log information description
The sample logs contain the following information in sequence:
Log generation time
Name of the current application
Trace ID
RPC ID
Logical data source name, which is left empty in ODP V1.x
Physical database information, in the format of Cluster:Tenant:Database
Database type, which can be OB or RDS
Logical table name, which is left empty in ODP V1.x
Physical table name
SQL command, such as
COM_QUERYorCOM_STMT_PREPARESQL type, such as
CREATE,READ,UPDATE, orDELETE(CRUD)Execution result, which can be success or failed
Error code, which is left empty when the execution result is success
SQL statement
Total execution duration in milliseconds, including the internal SQL execution duration
Pre-execution duration
Connection establishment duration
Database execution duration
Current thread name, which is the internal thread ID of ODP
System penetration data, such as system disaster recovery information
Penetration data
DBKey name (supported in OceanBase Database V2.0.20 and later)
Whether BeyondTrust is used (supported in OceanBase Database V2.0.20 and later). The value
1indicates that BeyondTrust is used. The value0indicates that BeyondTrust is not used.IP address of the backend OBServer node
Error details
Trace ID of the OBServer node
obproxy_limit.log file
The obproxy_limit.log file records ODP throttling logs. If throttling is performed on a request, the request information is sent to the log file.
The format of throttling information is as follows:
Throttling status or SQL throttling rule name. Valid values of the throttling status are RUNNING and OBSERVE.
Sample log
2020-03-18 21:26:54.871053,postmen,,,,postmen40:postmen_new0497_3279:postmen_r497,OB_MYSQL,,postmen_push_msg_4977,COM_QUERY,SELECT,RUNNING,SELECT id%2C gmt_create%2C gmt_modified%2C msg_id%2C principal_id%2C app_name%2C target_utdid%2C biz_id%2C host%2C status%2C expire_time%2C msg_data FROM postmen_push_msg_4977 WHERE principal_id = 'W/jEKoLOxnwDABWmhzjgmK1V' AND app_name = 'KOUBEI' AND expire_time > 1584538014858 AND status = 1,LIMIT_RULE_1
Log information description
The sample log contains the following information in sequence:
Log generation time
Name of the current application
Trace ID
RPC ID
Logical data source name, which is left empty in ODP V1.x
Physical database information, in the format of Cluster:Tenant:Database
Database type, which can be OB or RDS
Logical table name, which is left empty in ODP V1.x
Physical table name
SQL command, such as
COM_QUERYorCOM_STMT_PREPARESQL type, such as
CREATE,READ,UPDATE, orDELETE(CRUD)Throttling status, which can be
RUNNINGorOBSERVESQL statement
SQL throttling rule name
ODP monitoring
In addition to various ODP logs, you can view ODP monitoring information by using OCP. OCP is a database management and O&M service provided by OceanBase Database.
The cluster performance monitoring feature of ODP supports service monitoring and system monitoring.
Service monitoring
The service monitoring feature collects the following statistics for ODP clusters, OceanBase clusters that are associated with ODP, and ODP IP addresses: number of transactions per second, number of requests, number of client connections, number of server connections, SQL execution duration, number of error response packets per second, route table, and number of bytes for network requests.
System monitoring
The system monitoring feature collects the following statistics for ODP clusters and ODP IP addresses: Linux system load, CPU utilization, average number of I/O requests per second, average execution duration of I/O requests per second, average data amount of I/O requests per second, network throughput, memory usage, and disk usage.
For more information about ODP monitoring, see the ODP cluster performance monitoring section in OCP User Guide.