[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for Trino](../index.md) > [Step-by-step guides](index.md) > Logs and monitoring > Cluster state monitoring

# Cluster state monitoring Managed Service for Trino

Data on the cluster and host state is available in the [management console](https://console.yandex.cloud). You can view them on the **Monitoring** tab of the cluster management page or in [Yandex Monitoring](../../monitoring/concepts/index.md).

Diagnostic information about cluster states is presented as graphs.

Charts are updated every 15 seconds.

{% note info %}

The most appropriate multiple units (MB, GB, and more) are automatically used in charts.

{% endnote %}

You can [configure alerts](#monitoring-integration) in Yandex Monitoring to receive notifications about cluster failures. In Yandex Monitoring, there are two alert thresholds: `Warning` and `Alarm`. If the specified threshold is exceeded, you will receive alerts via the configured [notification channels](../../monitoring/concepts/alerting.md#notification-channel).

## Cluster state monitoring {#monitoring-cluster}

To view detailed information on the health state of a Managed Service for Trino cluster:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), navigate to the relevant folder.
  1. Navigate to **Managed Service for&nbsp;Trino**.
  1. Click the name of your cluster and select the **Monitoring** tab.

  1. To get started with Yandex Monitoring metrics, dashboards, or alerts, click **Open in Monium** in the top panel.

  The page displays the following charts:

  * Under **Cluster**:

    * **Total cluster nodes**: Number of cluster hosts.
    * **Total Available Processors**: Number of available CPUs.
    * **Cluster distributed memory (cluster memory pool)**: Amount of distributed cluster memory.
        
      * **Total Distributed Bytes**: Total memory (in GB).
      * **Free Distributed Bytes**: Available memory (in GB).

  * Under **Queries**:

    * **Queries (executing)**

      * **Running**: At least one part of the query plan is in progress.
      * **Queued**: Query is received and waiting to run.
      * **Progressing**: Query is in progress and not blocked.
      * **Finishing**: Query is almost complete.

    * **Queries (by status)**

      * **Submitted**: Received queries.
      * **Started**: Queries in progress.
      * **Failed**: Queries that resulted in an error.
      * **Completed**: Completed queries, including failed ones.
      * **Canceled**: Queries canceled by the user.
      * **Abandoned**: Completed queries with unclaimed results.

    * **Errors**: Errors and their types. The number of errors is given per second.

      * **UserError**: User-side errors.
      * **Internal**: Server-side error.
      * **InsufficientResources**: Errors caused by insufficient resources.
      * **External**: External errors.

  * Under **Execution**:

      * **Timings, p95 (One minute)**: 95th percentile of query execution time with a one minute window.

{% endlist %}

## Setting up alerts in Yandex Monitoring {#monitoring-integration}

To configure [cluster](#monitoring-cluster) state indicator alerts:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder with the cluster for which you want to set up alerts.
  1. Navigate to ![image](../../_assets/console-icons/display-pulse.svg) **Monitoring**.
  1. Under **Service dashboards**, select **Managed Service for Trino — Cluster Overview**.
  1. In the chart you need, click ![options](../../_assets/console-icons/ellipsis.svg) and select **Create alert**.
  1. If the chart displays multiple metrics, select the data query for the relevant metric and click **Continue**. You can learn more about the query language in [this Yandex Monitoring article](../../monitoring/concepts/querying.md).
  1. Set the `Alarm` and `Warning` threshold values to trigger the alert.
  1. Click **Create alert**.

{% endlist %}

To have other cluster health indicators monitored automatically:

{% list tabs group=instructions %}

- Management console {#console}

    1. [Create an alert](../../monitoring/operations/alert/create-alert.md).
    1. Add a status metric.
    1. In the alert parameters, set the alert thresholds.

{% endlist %}

For a complete list of supported metrics, see [this Monitoring guide](../../monitoring/metrics-ref/managed-trino-ref.md).

## Cluster health and status {#cluster-health-and-status}

A cluster’s _State_ indicates its health, while its _Status_ shows whether the cluster is started, stopped, or in a transitory state.

To view the health state and status of a cluster:

1. Open the [folder dashboard](https://console.yandex.cloud).
1. Navigate to **Managed Service for&nbsp;Trino**.
1. In the cluster row, hover over the indicator in the **Availability** column.

### Cluster health states {#cluster-health}

State | Description | Suggested actions
:--- | :--- | :---
**ALIVE** | The cluster is operating normally. | No action is required.
**DEGRADED** | The cluster is not running at its full capacity. | [Contact support](https://center.yandex.cloud/support) and specify the following:<ul><li>Cluster ID.</li><li>IDs of the last operations performed on it.</li><li>Time when the cluster entered the `DEGRADED` state according to [availability charts](#monitoring-cluster).</li></ul>
**DEAD** | The cluster is out of order. | [Contact support](https://center.yandex.cloud/support) and specify the following:<ul><li>Cluster ID.</li><li>IDs of the last operations performed on it.</li><li>Time when the cluster entered the `DEAD` state according to [availability charts](#monitoring-cluster).</li></ul>
**UNKNOWN** | The cluster’s state is unknown. | [Contact support](https://center.yandex.cloud/support) and specify the following:<ul><li>Cluster ID.</li><li>IDs of the last operations performed on it.</li><li>Time when the cluster entered the `UNKNOWN` state according to [availability charts](#monitoring-cluster).</li></ul>

### Cluster statuses {#cluster-status}

Status | Description | Suggested actions
:--- | :--- | :---
**CREATING** | Preparing for the first start | Wait a while and get started. The time it takes to create a cluster depends on the host class.
**RUNNING** | The cluster is operating normally | No action is required.
**STOPPING** | The cluster is stopping | After a while, the cluster status will switch to `STOPPED` and the cluster will be disabled. No action is required.
**STOPPED** | The cluster is stopped | Start the cluster to get it running again.
**STARTING** | Starting the cluster that was stopped earlier | After a while, the cluster status will switch to `RUNNING`. Wait a while and get started.
**UPDATING** | Updating the cluster's configuration | Once the update is complete, the cluster will get the status it had prior to the update: `RUNNING` or `STOPPED`.
**ERROR** | Error when performing an operation with the cluster or during a maintenance window | If the cluster remains in this status for a long time, [contact support](https://center.yandex.cloud/support). You can see whether a cluster is available by its status.
**STATUS_UNKNOWN** | The cluster is unable to determine its status | If the cluster remains in this status for a long time, [contact support](https://center.yandex.cloud/support).