[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for GitLab](../../index.md) > [Step-by-step guides](../index.md) > Instance state monitoring

# Managed Service for GitLab instance state monitoring

{% note info %}

This feature is at the [Preview](../../../overview/concepts/launch-stages.md) stage.

{% endnote %}

You can view instance state data in the **Monitoring** tab on the instance page or in [Yandex Monitoring](../../../monitoring/concepts/index.md).

Diagnostic information about the instance state is shown as charts. The charts automatically use the most appropriate multiple measurement units (GB, percentage, etc.).

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).

## Instance state monitoring {#view-graphs}

To view detailed information about the Managed Service for GitLab instance state:

1. Navigate to **Managed Service for&nbsp;GitLab**.
1. Click the instance name and select the **Monitoring** tab.
1. To get started with Yandex Monitoring metrics, dashboards, or alerts, click **Open in Monium** in the top panel.

You will see the following charts:

* **Data disk**: Amount of used and free space on the data storage disk.
* **System disk**: Amount of used and free space in the system storage.
* **CPU**: Processor core workload.
* **Memory**: RAM usage. At high workloads, the **Available memory** value goes down and the **Used memory** value goes up.

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

{% list tabs group=instructions %}

- Management console {#console}

   1. In the [management console](https://console.yandex.cloud), select the folder with the instance for which you want to set up alerts.
   1. Go to ![image](../../../_assets/console-icons/display-pulse.svg) **Monitoring**.
   1. On the home page, under **Service dashboards**, select **Managed Gitlab**.
   1. On the chart of interest, click ![options](../../../_assets/console-icons/ellipsis.svg) and select **Create alert**.
   1. If the selected chart contains multiple metrics in the **Alert configuration** section, you can keep all data queries or only specific ones. For example, for the **System disk** metric, you can remove the redundant free storage space query and keep only the used space query.

      To remove the redundant query, click ![options](../../../_assets/console-icons/ellipsis.svg) → **Delete** in the query row.

      You can learn more about the query language in [this Monitoring article](../../../monitoring/concepts/querying.md).

   1. Set the [alert trigger conditions](../../../monitoring/concepts/alerting/alert.md#condition):

      * Set the query name that will be used to calculate the alert status.

      * Select the aggregation function to apply to metric values in the time window.

      * Select the comparison function to compare the aggregation function result with threshold values.

      * Specify the `Warning` and `Alarm` threshold values. Select whether the current chart value should exceed, fall below, or match the threshold. 

      * Set the time window for alert evaluation and the evaluation delay.

   1. Click **Create**.

{% endlist %}

You can also create alerts for specific Managed Service for GitLab metrics. 

Recommended threshold values for certain metrics:

The recommended thresholds for the **Remaining free disk space** (`sys.filesystem.FreeB`) metric are as follows:

1. **Aggregation function**: **Average**.
1. **Comparison function**: **Less than or equal to**.
1. **Alarm**: 7% of the storage size.
1. **Warning**: 10% of the storage size.
1. **Evaluation window**: 5 minutes.
1. **Evaluation delay**: 30 seconds.

## Instance statuses {#statuses}

The _status_ shows whether the instance is started, stopped, or in a transitional state. You can view the status in the list of Managed Service for GitLab instances or on each instance's page.

The following statuses are possible:

#|
|| **Status** | **Description** | **Suggested actions** ||
|| **CREATING** | Preparing for the first start | Wait a while and get started. The time it takes to create an instance depends on the host class. ||
|| **RUNNING** | The instance is running normally. | No action is required. ||
|| **STOPPING** | Stopping the instance | After a while, the instance status will change to `STOPPED` and the instance will be taken offline. No action is required. ||
|| **STOPPED** | The instance is stopped. | Start the instance to get it running again. ||
|| **STARTING** | Starting the instance that was stopped earlier | After a while, the instance status will change to `RUNNING`. Wait a while and get started. ||
|| **UPDATING** | Updating the instance | After the update is complete, the cluster status will switch to `RUNNING`. Wait a while and get started. ||
|| **ERROR** | An error occurred that does not allow the instance to continue working. | Run the initial diagnostics:

* Review instance [monitoring charts](#view-graphs).
* On the instance page, under ![image](../../../_assets/console-icons/list-check.svg) **Operations**, check the operations performed in the instance.

If you cannot find the cause of the error yourself, [contact support](https://center.yandex.cloud/support). ||
|| **STATUS_UNKNOWN** | The instance is unable to determine its status. | Run the initial diagnostics:

* Review instance [monitoring charts](#view-graphs).
* On the instance page, under ![image](../../../_assets/console-icons/list-check.svg) **Operations**, check the operations performed in the instance.

If you cannot find the cause of the error yourself, contact support. ||
|| **DELETING** | Deleting the instance | Once deleted, the instance will be removed from the **Instances list** page and will no longer be accessible. No action is required.

When you delete an instance, the system automatically creates its backup which is stored for two weeks. If you need to restore an instance after deletion, contact support. ||
|#