OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database Proxy

V4.2.2

  • What is ODP?
  • Installation and deployment
    • Overview
    • Use OBD to deploy ODP
    • Deploy ODP by using OCP
    • Deploy ODP by using the CLI
    • Deployment modes
  • Basic operations
  • Configuration parameter
    • View and modify parameters
    • Parameter summary
    • Parameters that take effect dynamically
      • binlog_service_ip
      • cache_cleaner_clean_interval
      • check_tenant_locality_change
      • client_max_connections
      • client_max_memory_size
      • client_sock_option_flag_out
      • client_tcp_keepcnt
      • client_tcp_keepidle
      • client_tcp_keepintvl
      • client_tcp_user_timeout
      • cluster_count_high_water_mark
      • cluster_expire_time
      • config_server_refresh_interval
      • congestion_fail_window
      • congestion_failure_threshold
      • congestion_retry_interval
      • connection_diagnosis_option
      • connect_observer_max_retries
      • current_local_config_version
      • default_buffer_water_mark
      • default_inactivity_timeout
      • delay_exit_time
      • delay_update_entry_interval
      • detect_server_timeout
      • digest_sql_length
      • enable_abort_conn_info
      • enable_async_log
      • enable_async_pull_location_cache
      • enable_bad_route_reject
      • enable_binlog_service
      • enable_cached_server
      • enable_causal_order_read
      • enable_client_connection_lru_disconnect
      • enable_client_ip_checkout
      • enable_client_ssl
      • enable_cloud_full_username
      • enable_cluster_checkout
      • enable_compression_protocol
      • enable_congestion
      • enable_connection_diagnosis
      • enable_extra_prometheus_metric
      • enable_flow_control
      • enable_full_username
      • enable_get_rslist_remote
      • enable_index_route
      • enable_monitor_stat
      • enable_ob_protocol_v2
      • enable_ob_protocol_v2_with_client
      • enable_partition_table_route
      • enable_performance_mode
      • enable_pl_route
      • enable_primary_zone
      • enable_prometheus
      • enable_proxy_scramble
      • enable_qa_mode
      • enable_qos
      • enable_read_write_split
      • enable_report_session_stats
      • enable_reroute
      • enable_sequence_prefetch
      • enable_server_ssl
      • enable_sharding
      • enable_standby
      • enable_stat
      • enable_strict_stat_time
      • enable_sync_all_stats
      • enable_syslog_file_compress
      • enable_trace
      • enable_trace_stats
      • enable_trans_detail_stats
      • enable_transaction_internal_routing
      • enable_transaction_split
      • enable_weak_reroute
      • enable_xa_route
      • fetch_proxy_bin_random_time
      • fetch_proxy_bin_timeout
      • flow_consumer_reenable_threshold
      • flow_event_queue_threshold
      • flow_high_water_mark
      • flow_low_water_mark
      • hot_upgrade_exit_timeout
      • hot_upgrade_failure_retries
      • hot_upgrade_rollback_timeout
      • idc_list_refresh_interval
      • ignore_local_config
      • internal_cmd_mem_limited
      • ldg_info_refresh_interval
      • log_cleanup_interval
      • log_dir_size_threshold
      • log_file_percentage
      • long_async_task_timeout
      • max_log_file_size
      • max_syslog_file_count
      • max_syslog_file_time
      • metadb_server_state_refresh_interval
      • min_congested_connect_timeout
      • min_keep_congestion_interval
      • monitor_cost_ms_unit
      • monitor_item_limit
      • monitor_item_max_idle_period
      • monitor_log_level
      • monitor_stat_dump_interval
      • monitor_stat_high_threshold
      • monitor_stat_low_threshold
      • monitor_stat_middle_threshold
      • mysql_version
      • need_convert_vip_to_tname
      • net_config_poll_timeout
      • normal_pl_update_threshold
      • ob_max_read_stale_time
      • obproxy_force_parallel_query_dop
      • obproxy_read_consistency
      • obproxy_read_only
      • obproxy_sys_password
      • observer_query_timeout_delta
      • observer_sys_password
      • observer_sys_password1
      • partition_location_expire_relative_time
      • prometheus_sync_interval
      • proxy_hot_upgrade_check_interval
      • proxy_idc_name
      • proxy_info_check_interval
      • proxy_local_cmd
      • proxy_mem_limited
      • proxy_primary_zone_name
      • proxy_route_policy
      • proxy_tenant_name
      • qa_mode_mock_public_cloud_slb_addr
      • qos_stat_clean_interval
      • qos_stat_item_limit
      • query_digest_time_threshold
      • read_stale_retry_interval
      • refresh_idc_list
      • refresh_json_config
      • refresh_rslist
      • request_buffer_length
      • route_diagnosis_level
      • routing_cache_mem_limited
      • sequence_entry_expire_time
      • sequence_fail_retry_count
      • sequence_prefetch_threshold
      • server_detect_fail_threshold
      • server_detect_mode
      • server_detect_refresh_interval
      • server_routing_mode
      • server_state_refresh_interval
      • server_tcp_init_cwnd
      • server_tcp_keepcnt
      • server_tcp_keepidle
      • server_tcp_keepintvl
      • server_tcp_user_timeout
      • short_async_task_timeout
      • skip_proxy_sys_private_check
      • skip_proxyro_check
      • slow_proxy_process_time_threshold
      • slow_query_time_threshold
      • slow_transaction_time_threshold
      • sock_option_flag_out
      • sock_packet_mark_out
      • sock_packet_tos_out
      • sock_recv_buffer_size_out
      • sock_send_buffer_size_out
      • sql_table_cache_expire_relative_time
      • sql_table_cache_mem_limited
      • sqlaudit_mem_limited
      • ssl_attributes
      • stat_dump_interval
      • stat_table_sync_interval
      • syslog_level
      • target_db_server
      • tenant_location_valid_time
      • tunnel_request_size_threshold
      • username_separator
      • xflush_log_level
    • Parameters that take effect after a restart
      • automatic_match_work_thread
      • block_thread_num
      • enable_cpu_isolate
      • enable_cpu_topology
      • enable_global_ps_cache
      • enable_strict_kernel_release
      • grpc_client_num
      • grpc_thread_num
      • ip_listen_mode
      • listen_port
      • local_bound_ip
      • local_bound_ipv6_ip
      • net_accept_threads
      • obproxy_config_server_url
      • prometheus_cost_ms_unit
      • prometheus_listen_port
      • rootservice_cluster_name
      • rootservice_list
      • shard_scan_thread_num
      • stack_size
      • task_thread_num
      • work_thread_num
  • Connection management
    • Principles
    • Session status synchronization
    • Client session
    • Server session
    • Connection diagnostics
  • Data routing
    • Factors affecting data routing
    • ODP routing
    • Intra-tenant routing
      • Overview
      • IP address-based routing
      • Partitioned table-based routing for strong-consistency reads
      • Global index table-based routing for strong-consistency reads
      • Replication table-based routing for strong-consistency reads
      • Primary zone-based routing for strong-consistency reads
      • Strategy-based routing
      • Distributed transaction routing
      • Rerouting
      • Forcible routing
    • Read/Write separation
    • Follower latency threshold
  • High availability mechanism
    • Overview
    • High availability of ODP services
    • High availability of OceanBase Database
    • High availability testing
  • Security and protocols
  • Operation and maintenance
    • Troubleshooting
      • Troubleshooting logic
      • Monitoring logs
    • Performance analysis
    • Show Trace
    • Routing diagnostics
      • Overview
      • Obtain diagnostic information
      • Diagnostic point troubleshooting
        • Overview
        • SQL_PARSE
        • ROUTE_INFO
        • LOCATION_CACHE_LOOKUP
        • ROUTINE_ENTRY_LOOKUP_DONE
        • FETCH_TABLE_RELATED_DATA
        • TABLE_ENTRY_LOOKUP_DONE
        • EXPR_PARSE
        • CALC_ROWID
        • RESOLVE_TOKEN
        • RESOLVE_EXPR
        • CALC_PARTITION_ID
        • PARTITION_ID_CALC_DONE
        • PARTITION_ENTRY_LOOKUP_DONE
        • ROUTE_POLICY
        • CONGESTION_CONTROL
        • RETRY
        • HANDLE_RESPONSE
      • Examples
  • Release Notes
    • Versioning rules
    • Enterprise Edition
      • V4.2
        • ODP Enterprise Edition V4.2.2
        • ODP Enterprise Edition V4.2.1
      • V4.1
        • ODP Enterprise Edition V4.1.0
      • V4.0
        • ODP Enterprise Edition V4.0.0
      • V3.2
        • ODP V3.2.11
        • ODP Enterprise Edition V3.2.3.5
    • Community Edition
      • V4.2
        • ODP Community Edition V4.2.1
        • ODP Community Edition V4.2.0
      • V4.1
        • ODP Community Edition V4.1.0
      • V4.0
        • ODP Community Edition V4.0.0

Download PDF

What is ODP? Overview Use OBD to deploy ODP Deploy ODP by using OCP Deploy ODP by using the CLI Deployment modes Basic operations View and modify parameters Parameter summary binlog_service_ip cache_cleaner_clean_interval check_tenant_locality_change client_max_connections client_max_memory_size client_sock_option_flag_out client_tcp_keepcnt client_tcp_keepidle client_tcp_keepintvl client_tcp_user_timeout cluster_count_high_water_mark cluster_expire_time config_server_refresh_interval congestion_fail_window congestion_failure_threshold congestion_retry_interval connection_diagnosis_option connect_observer_max_retries current_local_config_version default_buffer_water_mark default_inactivity_timeout delay_exit_time delay_update_entry_interval detect_server_timeout digest_sql_length enable_abort_conn_info enable_async_log enable_async_pull_location_cache enable_bad_route_reject enable_binlog_service enable_cached_server enable_causal_order_read enable_client_connection_lru_disconnect enable_client_ip_checkout enable_client_ssl enable_cloud_full_username enable_cluster_checkout enable_compression_protocol enable_congestion enable_connection_diagnosis enable_extra_prometheus_metric enable_flow_control enable_full_username enable_get_rslist_remote enable_index_route enable_monitor_stat enable_ob_protocol_v2 enable_ob_protocol_v2_with_client enable_partition_table_route enable_performance_mode enable_pl_route enable_primary_zone enable_prometheus enable_proxy_scramble enable_qa_mode enable_qos enable_read_write_split enable_report_session_stats enable_reroute enable_sequence_prefetch enable_server_ssl enable_sharding enable_standby enable_stat enable_strict_stat_time enable_sync_all_stats enable_syslog_file_compress enable_trace enable_trace_stats enable_trans_detail_stats enable_transaction_internal_routing enable_transaction_split enable_weak_reroute enable_xa_route fetch_proxy_bin_random_time fetch_proxy_bin_timeout flow_consumer_reenable_threshold flow_event_queue_threshold flow_high_water_mark flow_low_water_mark hot_upgrade_exit_timeout hot_upgrade_failure_retries hot_upgrade_rollback_timeout idc_list_refresh_interval ignore_local_config internal_cmd_mem_limited ldg_info_refresh_interval log_cleanup_interval log_dir_size_threshold log_file_percentage long_async_task_timeout
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Database Proxy
  3. V4.2.2
iconOceanBase Database Proxy
V 4.2.2
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.3
  • V 4.2.2
  • V 4.2.0 and earlier

Monitoring logs

Last Updated:2024-03-07 08:37:59  Updated
share
What is on this page
Audit logs
SQL execution statistic logs
Slow SQL request logs
ODP error logs
ODP throttling logs
Prometheus

folded

share

Three tools are available to resolve OceanBase Database Proxy (ODP) issues: ODP logs, Linux commands (including network commands, system commands, and text commands), and OceanBase Cloud Platform (OCP). Reference materials about Linux commands and OCP are common on the Internet. We recommend that you learn the related knowledge to facilitate troubleshooting.

This topic describes ODP logs of different types.

Audit logs

Audit logs are recorded in the obproxy_digest.log file. It records requests whose execution time exceeds the threshold specified by the query_digest_time_threshold parameter, and requests with incorrect responses.

  • Log format

    Log printing time, current application name, trace ID, RPC ID, name of the logical data source, physical database information (cluster:tenant:database), database type (OB or RDS), name of the logical table, name of the physical table, SQL command, SQL type (CRUD), execution result (success or failed), error code (empty when the execution result is success), SQL statement, total SQL execution time (in us), pre-execution time, link establishment time, database execution time, current thread name, shard name, whether BT mode is used, system penetration data, and penetration data
    

    Notes:

    • The SQL command can be COM_QUERY or COM_STMT_PREPARE.

    • The total execution time includes the execution time of internal SQL statements.

    • The current thread name indicates the internal thread ID of the ODP.

    • The information about the shard name and whether BT mode is used can be printed in logs only in V2.0.20 and later. The value 1 indicates that the BT mode is used and the value 0 indicates that the BT mode is not used.

    • The system penetration data indicates the disaster recovery information of the system.

  • Example

    In this example, select sleep(3) from dual is used to simulate a slow SQL statement. After this statement is executed, view the obproxy_digest.log file. The log shows that the execution time on ODP is 409 μs and the execution time on the OBServer is 3039883 μs. The following example shows the content of the log:

    2022-07-11 14:32:51.758265,undefined,,,,obcluster:sys:test,OB_MYSQL,,,COM_QUERY,SELECT,success,,select sleep(3),3041116us,409us,0us,3039883us,Y0-7F4B1CEA13A0,,,,0,11.xxx.xxx.53:33041
    # The log fields are separated with commas (,). If the SQL statement contains a comma, it will be replaced with %2C. The result after replacement by using tr ',' '\n' is as follows:
       1,2022-07-11 14:32:51.758265    # The log printing time.
       2,undefined          # It is for internal use. You do not need to pay attention to it.
       3,                   # It is for internal use. You do not need to pay attention to it.
       4,                   # It is for internal use. You do not need to pay attention to it.
       5,                   # It is for internal use. You do not need to pay attention to it.
       6,obcluster:sys:test  # The information about the physical database, in the format of cluster name:tenant name:database name.
       7,OB_MYSQL         # The database type.
       8,                 # The name of the logical table.
       9,                 # The name of the physical table.
       10,COM_QUERY       # The SQL command, for example, COM_QUERY or COM_STMT_PREPARE.
       11,SELECT          # The SQL type.
       12,success         # The execution result. Valid value: success or failed.
       13,                # The error code, which is empty when the execution result is success.
       14,select sleep(3) # The SQL statement.
       15,3041116us       # The total execution time in us, including the execution time of internal SQL statements.
       16,409us           # The pre-execution time.
       17,0us             # The connection establishment time.
       18,3039883us       # The database execution time.
       19,Y0-7F4B1CEA13A0 # The trace ID of the internal log of the ODP.
       20,                # It is for internal use. You do not need to pay attention to it.
       21,                # It is for internal use. You do not need to pay attention to it.
       22,                # It is for internal use. You do not need to pay attention to it.
       23,0               # It is for internal use. You do not need to pay attention to it.
       24,11.xxx.xxx.53:33041  # The address of the OBServer to route to.
    

In an audit log, the 14th line records the executed SQL statement, and the 15th and 16th lines record the detailed execution time. If the execution in the database is slow, the time recorded in the 18th line is long.

SQL execution statistic logs

The obproxy_stat.log file records the SQL execution statistic logs. By default, a statistic log is generated once every minute. The generation interval is specified by the monitor_stat_dump_interval parameter. In this log, you can view the SQL statements executed by ODP within one minute.

  • Log format
Log printing time, current application name, name of the logical data source, physical database information (cluster:tenant:database), database type (OB or RDS), SQL type (CRUD), execution result (success or failed), error code (empty when the execution result is success), total requests, requests with an execution time in the range of [30 ms, 100 ms), requests with an execution time in the range of [100 ms, 500 ms), requests with an execution time greater than or equal to 500 ms, total execution time (in us, including the execution time of internal SQL statements), pre-execution time, and database execution time
  • Example

    To check whether ODP has request traffic, view this log record. Example:

    2022-07-11 10:26:59.499204,undefined,,obcluster:sys:test,OB_MYSQL,SELECT,success,,1,1,0,0,41480us,332us,40369us
    
    # Log analysis
    1,2022-07-11 10:26:59.499204   # The log printing time.
    2,undefined      # The logical tenant name.
    3,               # The name of the logical database.
    4,obcluster:sys:test  # The information about the physical database, in the format of cluster name:tenant name:database name.
    5,OB_MYSQL  # The database type.
    6,SELECT    # The SQL type.
    7,success   # The execution result. Valid value: success or failed.
    8,          # The error code, which is empty when the execution result is success.
    9,1         # The total number of requests.
    10,1           # The number of requests whose execution time ranges from 30 ms to 100 ms.
    11,0           # The number of requests whose execution time ranges from 100 ms to 500 ms.
    12,0           # The number of requests whose execution time is greater than 500 ms.
    13,41480us     # The total execution time in us, including the execution time of internal SQL statements.
    14,332us       # The pre-execution time.
    15,40369u      # The database execution time.
    

Slow SQL request logs

The obproxy_slow.log file logs slow SQL requests. Requests with the execution time greater than the threshold (default value: 500 ms) specified by the slow_query_time_threshold parameter are recorded.

  • Log format

    Log printing time, current application name, trace ID, RPC ID, name of the logical data source, physical database information (cluster:tenant:database), database type (OB or RDS), name of the logical table, name of the physical table, SQL command, SQL type (CRUD), execution result (success or failed), error code (empty when the execution result is success), SQL statement, total SQL execution time (in us), pre-execution time, link establishment time, database execution time, current thread name, system penetration data, and penetration data
    

    Notes:

    • The SQL command can be COM_QUERY or COM_STMT_PREPARE.

    • The total execution time includes the execution time of internal SQL statements.

    • The current thread name indicates the internal thread ID of the ODP.

    • The system penetration data indicates the disaster recovery information of the system.

  • Example

    2022-07-11 14:32:51.758270,undefined,,,,obcluster:sys:test,OB_MYSQL,,,COM_QUERY,SELECT,success,,select sleep(3),3041116us,409us,0us,3039883us,Y0-7F4B1CEA13A0,,,,0,11.xxx.xxx.53:33041
    

The obproxy.log file also records slow SQL queries and the keyword is Slow Query. The information recorded in the obproxy.log file is more detailed. For example, after the select sleep(3) from dual SQL statement is executed, you can find the following information in the obproxy.log file:

[2022-07-11 14:32:51.758195] WARN  [PROXY.SM] update_cmd_stats (ob_mysql_sm.cpp:8425) [74744][Y0-7F4B1CEA13A0] [lt=7] [dc=0] Slow Query: ((
client_ip={127.0.0.1:50422},   // The IP address of the client that executes the SQL query.
server_ip={11.xxx.xxx.53:33041}, // The IP address of the OBServer to which the SQL query is routed.
obproxy_client_port={100.xxx.xxx.179:52052},  // The address of the ODP that connects to the OBServer.
server_trace_id=Y81100B7C0535-0005E3460FBBE3CD-0-0, // The trace ID of the execution process in the target OBServer.
route_type=ROUTE_TYPE_NONPARTITION_UNMERGE_LOCAL, // The routing strategy used for the SQL query.
user_name=root,         // The username.
tenant_name=sys,        // The tenant name.
cluster_name=obcluster,  // The cluster name.
logic_database_name=,  // The name of the logical database.
logic_tenant_name=,    // The logical tenant name.
ob_proxy_protocol=0,   // The protocol type.
cs_id=14,         // The connection ID used during client logon, which is assigned by the ODP.
proxy_sessid=7230691598940700681, // The connection ID recorded when the client accesses OceanBase Database.
ss_id=21,
server_sessid=3221588238,  // The connection ID of the SQL query in the target OBServer. This ID is assigned by the OBServer.
sm_id=14,
cmd_size_stats={
    client_request_bytes:20,  // The size of the request packet sent by the client to the ODP.
    server_request_bytes:38,  // The size of the request packet sent by the ODP to the target OBServer.
    server_response_bytes:0,  // The size of the response packet sent by the target OBServer to the ODP.
    client_response_bytes:71}, // The size of the response packet sent by the ODP to the client.
cmd_time_stats={
    client_transaction_idle_time_us=0 // The time interval between the start of the current SQL query and the end of the last SQL query in the transaction. Unit: μs.
    client_request_read_time_us=97, // The time spent by the ODP on reading the request packets from the client socket. Unit: μs.
    client_request_analyze_time_us=95, // The time spent by the ODP on analyzing the SQL query sent by the client. Unit: μs.
    cluster_resource_create_time_us=0, // The time spent by the ODP on creating the cluster cache. The ODP needs to create the cluster cache only when it accesses the cluster for the first time. Unit: μs.
    pl_lookup_time_us=0,  // The time spent on retrieving the routing table based on the SQL query. Unit: μs.
    pl_process_time_us=0,  // The time spent on processing the routing table. Unit: μs.
    congestion_control_time_us=21,  // The time spent on retrieving the blacklist based on the SQL query. Unit: μs.
    congestion_process_time_us=3,  // The time spent on checking and filtering the blacklist based on the SQL query. Unit: μs.
    do_observer_open_time_us=55,  // The time spent on retrieving the available connections from the target OBServer, including the connection time (connect_time). Unit: μs.
        server_connect_time_us=0,  // The time spent on creating the connection between the client and the target OBServer. Unit: μs.
    server_sync_session_variable_time_us=0, // The time spent on initializing the target connection. The initialization process includes saving the login information (saved_login) and synchronizing the database, system variables, the last insert ID (the ID of the last record you added to your database, represented by last_insert_id), and the transaction start time (start_trans). Unit: μs.
        server_send_saved_login_time_us=0,  // The time spent on saving the logon information for the target connection. Unit: μs.
        server_send_use_database_time_us=0,  // The time spent on synchronizing the database for the target connection. Unit: μs.
        server_send_session_variable_time_us=0,  // The time spent on synchronizing modified system variables for the target connection. Unit: μs.
        server_send_all_session_variable_time_us=0,  // The time spent on synchronizing all system variables for the target connection. Unit: μs.
        server_send_last_insert_id_time_us=0, // The time spent on synchronizing the last insert ID (last_insert_id) for the target connection. Unit: μs.
        server_send_start_trans_time_us=0,  // The time spent on synchronizing the transaction start time (start_trans/begin) for the target connection. Unit: μs.
    build_server_request_time_us=23, // The time spent on creating the request packets to be sent to the target OBServer. Unit: μs.
    plugin_compress_request_time_us=0,  // The time spent on compressing the request packets. Unit: μs.
    prepare_send_request_to_server_time_us=409,  // The time elapsed from the moment OBProxy received the request from the client to the moment the request is forwarded to an OBServer for execution. The value of this parameter is the sum of the values of the preceding parameters. Unit: μs.
    server_request_write_time_us=32,  // The time spent by the ODP on sending the request packets to the target server socket. Unit: μs.
    server_process_request_time_us=3039883,  // The time spent by the OBServer on executing the SQL query. Unit: μs.
    server_response_read_time_us=67,  // The time spent by the ODP on reading the response packets from the server socket. Unit: μs.
    plugin_decompress_response_time_us=59, // The time spent on decompressing the response packets. Unit: μs.
    server_response_analyze_time_us=70,  // The time spent on analyzing the response packets. Unit: μs.
    ok_packet_trim_time_us=0,  // The time spent on trimming the last OK packet from the response packets. Unit: μs.
    client_response_write_time_us=185,  // The time spent by the ODP on sending the response packets to the client socket. Unit: μs.
    request_total_time_us=3041116}  // The total time spent by the ODP on processing the request. The value of this parameter is the sum of the values of the preceding parameters. Unit: μs.
sql=select sleep(3)   // The SQL query sent by the client.
))

ODP error logs

The obproxy_error.log file records ODP error logs. Queries with an execution error are logged in this log file, including ODP errors and errors returned by the OBServer.

  • Log format

    Log printing time, current application name, trace ID, RPC ID, name of the logical data source, physical database information (cluster:tenant:database), database type (OB or RDS), name of the logical table, name of the physical table, SQL command, SQL type (CRUD), execution result (success or failed), error code (empty when the execution result is success), SQL statement, total SQL execution time (in us), pre-execution time, link establishment time, database execution time, current thread name, system penetration data, penetration data, and error details
    

    Notes:

    • The SQL command can be COM_QUERY or COM_STMT_PREPARE.

    • The total execution time includes the execution time of internal SQL statements.

    • The current thread name indicates the internal thread ID of the ODP.

    • The system penetration data indicates the disaster recovery information of the system.

  • Example

    In the following example, the select obproxy_error from dual statement is used. The obproxy_error field in the statement is not enclosed by quotation marks and will be treated as a column. This results in an execution failure. The client returns the following error:

    MySQL [test]> select obproxy_error from dual;
    ERROR 1054 (42S22): Unknown column 'obproxy_error' in 'field list'
    

    The obproxy_error.log file records the following information for the error:

    2022-07-11 10:26:09.358231,undefined,,,,obcluster:sys:test,OB_MYSQL,,,COM_QUERY,SELECT,failed,1054,select obproxy_error from dual,42423us,454us,0us,41222us,Y0-7F4B1EF653A0,,,,0,11.xxx.xxx.53:33041,Unknown column 'obproxy_error' in 'field list'
    
    # Log analysis
    1,2022-07-11 10:26:09.358231    # The log printing time.
    2,undefined          # It is for internal use. You do not need to pay attention to it.
    3,                   # It is for internal use. You do not need to pay attention to it.
    4,                   # It is for internal use. You do not need to pay attention to it.
    5,                   # It is for internal use. You do not need to pay attention to it.
    6,obcluster:sys:test  # The information about the physical database, in the format of cluster name:tenant name:database name.
    7,OB_MYSQL         # The database type.
    8,                 # The name of the logical table.
    9,                 # The name of the physical table.
    10,COM_QUERY       # The SQL command, for example, COM_QUERY or COM_STMT_PREPARE.
    11,SELECT          # The SQL type.
    12,failed          # The execution result. Valid value: success or failed.
    13,1054            # The error code, which is empty when the execution result is success.
    14,select obproxy_error from dual  # The SQL statement.
    15,42423us         # The total execution time in us, including the execution time of internal SQL statements.
    16,454us           # The pre-execution time.
    17,0us             # The connection establishment time.
    18,41222us         # The database execution time.
    19,Y0-7F4B1EF653A0 # The trace ID of the internal log of the ODP.
    20,            # It is for internal use. You do not need to pay attention to it.
    21,           # It is for internal use. You do not need to pay attention to it.
    22,          # It is for internal use. You do not need to pay attention to it.
    23,0          # It is for internal use. You do not need to pay attention to it.
    24,11.xxx.xxx.53:33041  # The address of the OBServer to route to.
    25,Unknown column 'obproxy_error' in 'field list' # The error message.
    

    The 12th line shows an execution failure. The 27th line shows the address information about the OBServer that executed the SQL query. The 28th line shows the error message. You can determine, based on the preceding information, that a database execution failure occurred.

ODP throttling logs

The obproxy_limit.log file records ODP throttling logs. Throttled requests are logged in this file.

  • Log format

    Log printing time, current application name, trace ID, RPC ID, name of the logical data source, physical database information (cluster:tenant:database), database type (OB or RDS), name of the logical table, name of the physical table, SQL command (such as COM_QUERY or COM_STMT_PREPARE), SQL type (CRUD), throttling status (RUNNING or OBSERVE), SQL statement, and SQL throttling rule name
    
  • Example

    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
    

Prometheus

In addition to a log system, ODP further provides the Prometheus system for integration with different monitoring platforms. Prometheus provides information such as the total number of requests, execution time, number of frontend connections, and number of backend connections. The following table describes the monitoring metrics.

Metric Required Description
odp_transaction_total Yes The total number of transactions.
odp_sql_request_total Yes The total number of requests.
odp_sql_cost_total Yes The total execution time of the requests.
odp_current_session Yes The current number of sessions.
odp_entry_total No The number of table entry requests.
odp_request_byte No The number of bytes in the request.

Previous topic

Troubleshooting logic
Last

Next topic

Performance analysis
Next
What is on this page
Audit logs
SQL execution statistic logs
Slow SQL request logs
ODP error logs
ODP throttling logs
Prometheus