Monitoring and logs in Managed Service for MySQL®
How do I view cluster and host charts?
In the management console
To view charts in Yandex Monitoringservice to Managed Service for MySQL.
How do I view logs?
- Go to the cluster page and open the Logs tab.
- At the top of the page, select a log:
MYSQL_ERROR: Primary MySQL® log with error messages, which is always enabled.MYSQL_SLOW_QUERY: Information on slow queries. It is enabled iflong_query_timeis greater than0.MYSQL_AUDIT: Information on database connections.MYSQL_GENERAL: Full query list. We recommend enabling it only for cluster debugging in a development environment.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the CLI command for viewing logs:
yc managed-mysql cluster list-logs --help -
Run the
yc managed-mysql cluster cluster list-logscommand.
What is the retention period for logs?
Cluster logs are stored for 30 days.
How do I view current queries?
To view the current user’s queries, run:
SHOW PROCESSLIST;
For a detailed description of the query result, see this MySQL® article
What other diagnostic information is available?
A user with the PROCESS cluster-level privilege can run the following queries:
SHOW FULL PROCESSLISTSHOW ENGINE INNODB STATUSSELECTfrom theperformance_schemaandsyssystem schemas.
To grant a user the PROCESS privilege, run this CLI command:
yc managed-mysql user update \
--global-permissions PROCESS <username> \
--cluster-id <cluster_ID>
How do I set up alerts?
Use Yandex Monitoring
When selecting a metric, set service to Managed Service for MySQL.
How do I set up an alert that triggers as soon as a certain percentage of disk space has been used up?
Create an alert for the disk.used_bytes metric in Yandex Monitoring. This metric shows the disk space usage in the Managed Service for MySQL® cluster.
For disk.used_bytes, use notification thresholds. Their recommended values are as follows:
Alarm: 90% of disk spaceWarning: 80% of disk space
Thresholds values must be specified in bytes. For example, the recommended values for a 100 GB disk are as follows:
Alarm:96636764160bytes (90%)Warning:85899345920bytes (80%)