> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/tools/enterprise/control-center/gg9/alerting.md).

# Alerting

Configuring metric-based alerts, notification channels, and webhook payloads for GridGain 9 clusters in Control Center.

On the **Alerting** screen, you can configure alerts for user-defined conditions that could indicate cluster issues.

You can use one of the available numeric metrics to specify the condition. For example, you can specify a condition for sustained high CPU load or excessive disk usage on nodes. If a condition lasts for the specified time, Control Center sends a notification via email, SMS, or webhook.

Each alert can have multiple channels assigned.

{% hint style="info" %}
Depending on configuration, [secured clusters](/docs/tools/enterprise/control-center/gg9/authorization-permissions.md) might require a cluster-level authentication for some (or all) of the actions.
{% endhint %}

## Creating Alerts

On the **CONFIGURATIONS** tab, click the **ADD ALERT** button and fill out the fields of the dialog box that appears.

![Create Alert](https://2850516351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkuTXWg0NDbRx6XUeYpGD%2Fuploads%2Fgit-blob-5cad7fd5b3aa344bf9417344ee7d074a39dc5a2d%2Fcc-gg8-create_alert.png?alt=media)

| Field                 | Description                                                                                                                                                                                |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name                  | The name of the alert                                                                                                                                                                      |
| Metric name           | The metric that you want to monitor                                                                                                                                                        |
| Condition             | The condition to be met                                                                                                                                                                    |
| Value                 | The value to which the metric is to be compared                                                                                                                                            |
| Grace Period          | The amount of time that the condition can exist before an alert is generated. The grace period prevents occasional spikes from triggering alerts. A setting of `0` enables instant alerts. |
| Notification Channels | The notification channels that are associated with the alert. To create a notification channel, click **ADD NOTIFICATION CHANNEL**.                                                        |

## Viewing Alert History

The **Alerts** tab displays the alert history.

![Alert History](https://2850516351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkuTXWg0NDbRx6XUeYpGD%2Fuploads%2Fgit-blob-95febd02c1f5a1a2ac875d2fbd5c3c9851d5e27f%2Fcc-gg8-alert-history.png?alt=media)

| Column        | Description                                                                                                                                                                            |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Created On    | The time when the alert was generated.                                                                                                                                                 |
| Status        | <p>The status of the alert:<br>- Alerting - the alert is active (has been triggered and is sending messages)<br>- Ok - the alert is inactive (the triggering condition has passed)</p> |
| Message       | The alert message.                                                                                                                                                                     |
| Configuration | The configuration of the alert.                                                                                                                                                        |

The **Filter** section, on the right, enables you to filter the alert list by configuration, status, and the creation period.

## Creating Notification Channels

{% hint style="info" %}
If you are running a self-hosted Control Center, configure email server and/or SMS provider settings. See [Configuration](/docs/tools/enterprise/control-center/admin-guide/configuration.md).
{% endhint %}

To create a notification channel:

1. Go to the **NOTIFICATION CHANNELS** tab and click **ADD NOTIFICATION CHANNEL**.
2. Enter the name of the notification channel.
3. In the **Send with** field, select **Email**, **SMS** or **Webhook**.
4. In the **Send to** field, enter an email address or a phone number. If **Webhook** option is selected, provide the URL of the endpoint that accepts alerts.

![Add Notification Channel](https://2850516351-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkuTXWg0NDbRx6XUeYpGD%2Fuploads%2Fgit-blob-2f97b7faca74e0d6663f6bbc1c7de1cc9056cb6a%2Fcc-gg8-notification_channel.png?alt=media)

### Configure Webhook Notifications

When an alert is triggered, Control Center sends a `POST` request to the configured webhook URL with the following JSON payload:

| Column           | Description                                                                                                                                                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eventType        | Event type. Always is `CONTROL_CENTER_ALERT`.                                                                                                                                                                                                  |
| alertId          | ID of the triggered alert.                                                                                                                                                                                                                     |
| alertName        | Alert name as configured in Control Center (e.g. `High CPU Usage`).                                                                                                                                                                            |
| clusterId        | ID of the cluster that triggered the alert.                                                                                                                                                                                                    |
| clusterTag       | Cluster name (for GridGain 9 clusters) or cluster tag (for GridGain 8) associated with the cluster (e.g. `production-cluster`).                                                                                                                |
| state            | <p>Current state of the alert. Possible values:<br>- <code>ALERTING</code> – The condition has lasted long enough, so the alert is now active.<br>- <code>GOOD</code> – The condition is no longer met; the system has returned to normal.</p> |
| message          | Alert message describing the condition that caused it (e.g. `CPU usage has exceeded 80% threshold`).                                                                                                                                           |
| timestamp        | Time the alert was triggered, in milliseconds.                                                                                                                                                                                                 |
| controlCenterUrl | URL of the Control Center instance that sent an alert.                                                                                                                                                                                         |

Below is a sample JSON sent by the Control Center when an alert is triggered:

```json
{
  "eventType": "CONTROL_CENTER_ALERT",
  "alertId": "123e4567-e89b-12d3-a456-426614174000",
  "alertName": "High CPU Usage",
  "clusterId": "987fcdeb-51a2-43d7-b123-456789abcdef",
  "clusterTag": "production-cluster",
  "state": "ALERTING",
  "message": "CPU usage has exceeded 80% threshold",
  "timestamp": 1704067200000,
  "controlCenterUrl": "https://control-center.example.com"
}
```
