This topic describes how to enable or disable end-to-end tracing for a tenant and provides usage instructions.
Background information
After enabling end-to-end tracing, you can:
- Query the link diagnosis results of abnormal SQL statements in Log Services > Trace Query. For more information, see Query links.
- In SQL Diagnosis > SlowSQL > SQL Sampling, select to view the call chain. For more information, see Diagnose SlowSQL.
OCP V4.2.1 introduces support for end-to-end tracing configuration at the tenant and session levels. You can enable or disable it for specified objects as needed.
Notice
By default, end-to-end tracing impacts the performance of OceanBase Database services by about 2%. It is recommended to disable this feature in performance-critical scenarios.
Prerequisites
Ensure the current OCP user has the following permissions:
- Cluster Maintenance or Tenant Maintenance resource permissions.
- Permission to access the Overview menu for the tenant.
End-to-end tracing related configurations have been enabled. For details, see Configure link query parameters.
Configure end-to-end tracing for a tenant
You can enable or disable end-to-end tracing on the tenant overview page.
Note
- A business tenant that is locked cannot have end-to-end tracing enabled (except for the sys tenant).
- Having end-to-end tracing enabled (for a tenant or session) does not prevent the business tenant from being locked. The end-to-end tracing feature is disabled by default.
- Having end-to-end tracing enabled (for a tenant or session) does not prevent the business tenant from being deleted.
- Disabling tenant-level end-to-end tracing also disables end-to-end tracing for all sessions under the tenant.
- Changes to tenant-level end-to-end tracing apply to all sessions under the tenant.
Log in to OCP.
In the left navigation bar, select Tenant. The system enters the Tenants tab by default.
On the Tenants page, select the target tenant and click its name to go to the tenant Overview page.
Click the ... icon in the upper-right corner and select End-to-end Tracing Configuration.
Configure the parameters.
ParameterDescriptionTracking Level Valid values: Level 1, Level 2, and Level 3. Level 1 is coarse-grained at the module level, and Level 3 is the finest-grained. Sampling Ratio Default: 10%. Value range: 0–100%. Sampling Content - ALL: Print all sampled logs that hit the sampling threshold.
- ONLY_SLOW_QUERY: Print to the log file only those slow queries that are sampled. Discard others. For this printing strategy, "slow" refers to the slow query threshold provided by the server (default value).
- SAMPLE_AND_SLOW_QUERY: Print sampled slow queries (as specified in ONLY_SLOW_QUERY), and print sampled logs with a probability of one in ten thousand (as specified in ALL). In this case, you must set force flush.
Enable/Disable Enabled by default. If disabled, the end-to-end tracing feature is disabled.
Configure end-to-end tracing at the session level
You can enable or disable the end-to-end tracing feature through the end-to-end tracing configuration on the Session Management page.
- If tenant-level end-to-end tracing is enabled, you can individually disable the switch for a single session.
- Changes to session-level end-to-end tracing apply only to the current session.
Procedure:
Log in to OCP.
In the left-side navigation pane, choose Tenant. The system goes to the Tenants tab by default.
On the Tenants page, find the target tenant and click its name to go to the tenant Overview page.
In the left-side navigation pane of the tenant page, choose Sessions.
In the tenant session list, find the target session, and choose More > End-to-end Tracing Configuration.
Configure the parameters.
ParameterDescriptionTracking Level Valid values: Level 1, Level 2, and Level 3. Level 1 is coarse-grained at the module level, and Level 3 is the finest-grained. Sampling Ratio Default: 10%. Value range: 0–100%. Sampling Content - ALL: Print all sampled logs that hit the sampling threshold.
- ONLY_SLOW_QUERY: Print to the log file only those slow queries that are sampled. Discard others. For this printing strategy, "slow" refers to the slow query threshold provided by the server (default value).
- SAMPLE_AND_SLOW_QUERY: Print sampled slow queries (as specified in ONLY_SLOW_QUERY), and print sampled logs with a probability of one in ten thousand (as specified in ALL). In this case, you must set force flush.
Enable/Disable Enabled by default. If disabled, the end-to-end tracing feature is disabled.
