[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for MySQL®](../index.md) > FAQ > Monitoring and logs

# Monitoring and logs in Managed Service for MySQL®

* [How do I view cluster and host charts?](#charts)

* [How do I view logs?](#logs)

* [How longs are logs retained?](#log-keeping)

* [How do I view current queries?](#current-queries)

* [What other diagnostic information is available?](#trouble-info)

* [How do I set up alerts?](#alerts)

* [How do I set up an alert to signal when my disk space is a certain percentage full?](#disk-space-percentage)

#### How do I view cluster and host charts? {#charts}

In the [management console](https://console.yandex.cloud), go to the cluster page. To view [cluster charts](../operations/monitoring.md#monitoring-cluster), navigate to **Monitoring**. For [individual host charts](../operations/monitoring.md#monitoring-hosts), go to **Hosts** → **Monitoring**.

To view charts in [Yandex Monitoring](https://monitoring.yandex.cloud), select the **Managed Service for&nbsp;MySQL** service dashboard on the home page. To view individual metrics, go to **Metrics** and set `service` to **Managed Service for MySQL**.

#### How do I view logs? {#logs}

{% list tabs group=instructions %}

- Management console {#console}

   1. Go to the cluster page and open the **Logs** tab.
   1. 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 if `long_query_time` is greater than `0`.
      * `MYSQL_AUDIT`: Information on database connections.
      * `MYSQL_GENERAL`: Full query list. We recommend enabling it only for cluster debugging in a development environment.

- CLI {#cli}

   If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

   1. See the description of the CLI command for viewing logs:

      ```bash
      yc managed-mysql cluster list-logs --help
      ```

   1. Run the `yc managed-mysql cluster cluster list-logs` command.

{% endlist %}

#### What is the retention period for logs? {#log-keeping}

Cluster logs are stored for 45 days.

#### How do I view current queries? {#current-queries}

To view the current user’s queries, run:

```sql
SHOW PROCESSLIST;
```

For a detailed description of the output, see [this MySQL® guide](https://dev.mysql.com/doc/refman/5.7/en/show-processlist.html).

#### What other diagnostic information is available? {#trouble-info}

A user with the `PROCESS` cluster-level [privilege](../concepts/settings-list.md#setting-administrative-privileges) can run the following queries:
* `SHOW FULL PROCESSLIST`
* `SHOW ENGINE INNODB STATUS`
* `SELECT` from the `performance_schema` and `sys` system schemas.

To grant a user the `PROCESS` privilege, run this [CLI](../../cli/index.md) command:

```bash
yc managed-mysql user update \
    --global-permissions PROCESS <username> \
    --cluster-id <cluster_ID>
```


#### How do I set up alerts? {#alerts}

Use [Yandex Monitoring](https://monitoring.yandex.cloud). For the setup guide, see [Creating an alert](../../monitoring/operations/alert/create-alert.md).

When selecting a metric, set `service` to **Managed Service for MySQL**.


#### How do I configure an alert for when disk space usage reaches a certain percentage? {#disk-space-percentage}

[Create an alert](../operations/monitoring.md#monitoring-integration) 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. With the following recommended values:

* `Alarm`: 90% of disk space.
* `Warning`: 80% of 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%).