MySQL Telemetry and OCI Log Analytics
Exports MySQL server logs to OCI Log Analytics.
Telemetry provides a convenient method to view and analyze the MySQL server logs using the OCI Log Analytics Service instead of relying solely on the MySQL command-line client.
Prerequisites
Prerequisites for sending MySQL Logs to OCI Log Analytics.
To send MySQL Logs to OCI Log Analytics, ensure the following:
- You have access to the OCI Log Analytics service and appropriate
permissions.
Note
Log Analytics is a billable service, it is not included in your MySQL HeatWave Service subscription and must be activated separately. See Log Analytics for more information. - You have created at least one Log Analytics Log Group. This is required to store the MySQL logs.
- Your DB System runs MySQL version 9.6.1 or higher.
- You DB System is standalone. Exporting MySQL logs to OCI Log Analytics is not currently supported by High Availability DB Systems or DB Systems with Read Replicas.
- Your DB System is not Always-free-tier, which has no access to Log Analytics.
- You have defined IAM policies as described in Policies.
- To log SQL statements in the Audit Log, you must define Audit Log filters. See Audit Log Filtering.
MySQL Logs
Exports MySQL server logs to OCI Log Analytics or to custom OpenTelemetry endpoints.
The following logs can be exported:
- Error log: Contains a record of mysqld startup and shutdown times. It also contains diagnostic messages such as errors, warnings, and notes that occur during server startup and shutdown, and while the server is running.
- Slow query log: Consists of SQL statements that take more than
long_query_timeseconds to execute and require at leastmin_examined_row_limitrows to be examined. The slow query log can be used to find queries that take a long time to execute and are therefore candidates for optimization. - Audit log: Contains client connection and disconnect details, and what actions they perform while connected, such as which databases and tables they access.
- General log: A general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and logs each SQL statement received from clients.
Viewing MySQL Logs in OCI Log Analytics
You can view the configured MySQL Logs in the OCI Log Analytics Log Explorer.
This task assumes you have configured all required Prerequisites.