> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-engineering/chaos-experiments/alert-integration.md).

# Alerts for chaos experiment

This topic describes how you can create email alerts for your chaos experiments.

### Experiment Alerts <a href="#experiment-alerts" id="experiment-alerts"></a>

Alerts provide crucial updates about your experiment runs, keeping you informed about the start, stop, and completion of your chaos experiments based on the experiment event you have configured to receive the alerts for).

#### Importance of Alerts <a href="#importance-of-alerts" id="importance-of-alerts"></a>

Alerts provide the status of the chaos experiments and other details, including run details, fault configurations, probes used, and so on). These updates can be valuable for making informed business decisions and serve as historical data for previous experiment runs.

#### Create and Use Alerts <a href="#create-and-use-alerts" id="create-and-use-alerts"></a>

You can setup alerts by [creating a channel](#create-a-channel) and [defining conditions](#create-a-condition). Once setup, you can [apply these conditions](#select-channel-for-alerts) to a rule.

{% hint style="info" %}

* Ensure that SMTP is configured on your account. HCE configures SMTP for you as a part of the basic setup for your application.
* To configure SMTP, ensure your account is connected to at least one delegate, regardless of the scope.
  {% endhint %}

#### Ensure SMTP is Configured <a href="#ensure-smtp-is-configured" id="ensure-smtp-is-configured"></a>

1. To verify SMTP configuration for your account, navigate to **Administrative Settings**.

   ![](/files/iTbPOmeMU4ukO2Y94bO4)
2. Check if **SMTP Configuration** is marked as **Configured**.

   ![](/files/cinRPRuhbe8HBvlNPnRg)

#### Create a Channel <a href="#create-a-channel" id="create-a-channel"></a>

1. Navigate to **Chaos Engineering** module. Select **Project Settings**, then under **Notifications and alerts**, select **Notification Channels**.

   ![](/files/x4hG2z4FdS8wXTP9VKlt)

{% hint style="info" %}
Notification management should be configured at the project settings level within the **Chaos Engineering** module. This is because HCE supports chaos experiments as a project-level entity, making the rule a project-level entity.
{% endhint %}

2. Click **+ New Channel**.

   ![](/files/09MuPcoONFoQrBnuVnMD)
3. Enter a **Channel Name**, select **Channel Type** (currently supports email only), and provide the associated value for channel type (email in this case). Select **Apply**.

   ![](/files/aAnAG3DEIo2KXGYswiZA)

This creates a new channel.

![](/files/TGlZa3dVN7aJTMuF1l4Q)

{% hint style="info" %}
Ensure you create a channel before creating a rule because a channel decides which method (email, slack, and so on) you wish to receive the alerts.
{% endhint %}

#### Create a Rule <a href="#create-a-rule" id="create-a-rule"></a>

1. Navigate to **Project Settings**, then under **Notifications and alerts**, select **Notification Rules**. To create a new rule, click **+ New Notification**.

   ![](/files/MHzUNAgeYdugQ4lwpcuo)
2. Enter a **Notification Name** and select **Continue**. Select **Chaos Experiments** as **Resource Type** because HCE currently supports alerting for chaos experiments only. Click **Continue**.

   ![](/files/WbrxlTWQWdAsw01QhHiO)

{% hint style="info" %}
HCE currently supports selecting resource types as chaos experiments for both Kubernetes and Linux chaos experiments.
{% endhint %}

4. You can associate a rule with one or more conditions. Select **+ Add Condition**. In the modal that appears, you can either create a condition or select one or more existing conditions. Select **Continue**.

#### Create a Condition <a href="#create-a-condition" id="create-a-condition"></a>

1. Provide a **Condition Name**, select the events (such as chaos experiment started, stopped, or completed) for which you want to receive the alerts. Select **Apply**.

   ![](/files/rlHDUMXZ3tezn6gUXZej)
2. Review the conditions configured for your rule and click **Continue**.

#### Select Channel for Alerts <a href="#select-channel-for-alerts" id="select-channel-for-alerts"></a>

1. Click **Select Channels**. Choose channel/s that you configured earlier and select **Apply Selected**. To create a new channel, select **New Channel**.

   ![](/files/UKnIKxx8CSux0MkLfkcZ)
2. Select **Apply Selected**.

   ![](/files/ZJJBll1S73eYNzp4vKIQ)
3. You can **Enable** or disable the rule based by selecting or deselecting the radio button. By default, it is set to **Enable on Save**. Select **Submit**.

   ![](/files/uvTyucC8KC6Vu4xyddyK)

{% hint style="info" %}
You can create multiple rules on the same chaos experiment, which will result in receiving multiple alerts (one per rule) for that experiment.
{% endhint %}

### Sample Run report <a href="#sample-run-report" id="sample-run-report"></a>

Once you've set up your email to receive alerts for completed chaos experiments (as part of [creating conditions](#create-a-condition)) and the feature flag is enabled, you'll receive a run report as an attachment. This report will include details like run information, fault details, and more.

![](/files/4n4xFOznXt4VgqlNzy1q)

{% hint style="info" %}
Currently, you will only receive the report if you've configured a condition to receive alerts for **Completed** chaos experiments. You can't opt-out of receiving alerts for completed experiments.
{% endhint %}

### Delete a Rule <a href="#delete-a-rule" id="delete-a-rule"></a>

Select the rule and click **Delete**. Confirm by selecting **Delete**.

![](/files/1Jz7vJFjWXlPI10RyqEJ)

### Next Steps <a href="#next-steps" id="next-steps"></a>

* [Runtime Variable Support for Experiments](/resilience-testing/chaos-engineering/chaos-experiments/fault-template.md)
