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_time
is 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 command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder 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-logs
command.
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 PROCESSLIST
SHOW ENGINE INNODB STATUS
SELECT
from theperformance_schema
and thesys
system 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
:96636764160
bytes (90%)Warning
:85899345920
bytes (80%)