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 parameter to Managed Service for MySQL.
How do I view logs?
- Go to the cluster page and click the Logs tab.
- At the top of the page, select an available log:
MYSQL_ERROR: Primary MySQL® log containing error messages. Always enabled.MYSQL_SLOW_QUERY: Information on slow queries. 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 purposes in the 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.
-
View a description of the CLI command to view the 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 output, see the MySQL® documentation
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_schemaand thesyssystem 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 the service parameter 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 with 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. The recommended values are as follows:
Alarm: 90% of the disk spaceWarning: 80% of the disk space
Thresholds are set in bytes only. For example, the recommended values for a 100 GB disk are as follows:
Alarm:96636764160bytes (90%)Warning:85899345920bytes (80%)