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

# Monitoring and logs in Managed Service for PostgreSQL

* [Where can I track my disk space utilization to avoid exceeding the 95% limit triggering read-only mode?](#disk-space)

* [Are logs stored on the same disk as PostgreSQL data? How are they billed?](#logs-storage)

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

* [What are WALs and what is their purpose?](#wal)

* [What does the `Cached` metric indicate in the RAM monitoring of a PostgreSQL cluster host?](#cached)

* [How do I get alerts on critical PostgreSQL cluster metrics?](#notifications)

* [How do I set up an alert that triggers when a certain percentage of disk space is used?](#disk-space-percentage)

#### Where can I track my disk space utilization to avoid exceeding the 95% limit triggering read-only mode? {#disk-space}

You can monitor your disk space usage:
* In the management console using the [cluster health monitoring tools](../operations/monitoring.md#monitoring-cluster).
* In [Yandex Monitoring](https://monitoring.yandex.cloud) that also allows you to [set up alerts](../operations/monitoring.md#monitoring-integration) for specified metrics.

#### Are logs stored on the same disk as PostgreSQL data? How are they billed? {#logs-storage}

Logs are stored on separate disks from data and are rotated automatically. You can view log information using the following [CLI](../../cli/index.md) command:

```bash
yc managed-postgresql cluster list-logs <cluster_ID>
```

Cluster log storage is free of charge.

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

Cluster logs are stored for 45 days.

#### What are WALs and what is their purpose? {#wal}

[Write-Ahead Logs](https://postgrespro.com/docs/postgresql/12/wal-intro) are used for writing data to the disk and for data replication. WALs are created during write requests and occupy disk space until log data is fully written to host disks, which ensures DBMS reliability and fault tolerance.

For more details on how PostgreSQL works, refer to its [official documentation](https://postgrespro.com/docs/postgresql/12).

#### What does Cached mean in the RAM monitoring of a PostgreSQL cluster host? {#cached}

`Cached` stands for cached data. Most operations are performed in RAM where the entire database working set is stored. Since caching occurs both for databases and the disk itself, the amount of cached data can exceed the storage size.

If application RAM consumption increases, some of the memory used for cache can be freed up.

For more details on disk data caching in Linux, refer to the relevant [guides](https://www.linuxatemyram.com/).


#### How do I get alerts on critical PostgreSQL cluster metrics? {#notifications}

Use [Yandex Monitoring](https://monitoring.yandex.cloud) and [set up alerts](../operations/monitoring.md#monitoring-integration) for the metrics critical for you.


#### How can I configure an alert for when disk 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 a Managed Service for PostgreSQL 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%).