Alerts for chaos experiments
This topic describes how you can create email alerts for your chaos experiments.
What are alerts?
Alerts are a form of communication that provide updates about your experiment runs. These alerts are provided in the form of email updates that describe your chaos experiments that started, stopped, and completed (depending on which type of experiment events you have configured to receive the alerts for).
Why are they required?
Alerts provide the status of the chaos experiments and other details (such as run details, fault configurations, probes used, and so on) that might be required when making important business decisions. You can also use alerts as historical data for the earlier chaos experiment runs.
How to create and use alerts?
You can create an alert by creating a channel and creating conditions. You can apply these conditions to a rule.
This feature is currently behind the feature flag PL_CENTRAL_NOTIFICATIONS
. Contact Harness Support to enable this feature.
- Ensure that you have SMTP 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 one delegate (irrespective of the scope).
Ensure SMTP is configured
-
To ensure that SMTP is configured for your account, navigate to Administrative Settings.
-
Validate if SMTP Configuration shows the status as Configured.
Create a channel
-
Navigate to Chaos Engineering module.
-
Select Project Settings and then Notifications Management.
The notification management should be configured at the project settings in the chaos engineering module only. This is because HCE currently supports chaos experiments which is a project-level entity, thereby making the rule a project-level entity.
-
Select Channels and + New Channel.
-
Provide a Channel Name, Channel Type (currently supports email only), and associated value for channel type (email in this case). Select Apply.
This creates a new channel for you.
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.
Create a rule
-
To create a new rule, select + New Notification.
-
Provide a Notification Name and select Continue.
-
Select the Resource Type as Chaos Experiments, because HCE currently supports alerting for chaos experiments only. Select Continue.
HCE currently supports selecting resource types as chaos experiments from Kubernetes and Linux chaos experiments.
-
You can associate a rule with one or more conditions. select + Add Condition. In this modal, you can either create a condition or select one or more conditions that you created earlier. Select Continue.
Create a condition
-
Provide the Condition Name, events (such as chaos experiment started, stopped, or completed) for which you wish to receive the alerts. Select Apply.
-
You can see some conditions configured for your rule. Select Continue.