> 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/feature-management-experimentation/new-to-fme/get-started/create-a-metric-alert-policy.md).

# Create a Metric Alert Policy

A metric alert policy allows you to configure a degradation threshold for your metrics. Harness FME monitors your metric impact for every feature flag using a percentage rollout, for the duration of the monitoring window. You are alerted if the observed impact for a metric exceeds the threshold you define.

{% hint style="info" %}
**Access to alert policies**

To enable alert policies for your account, contact your customer success manager or [Harness Support](/feature-management-experimentation/troubleshooting-and-resources/fme-support.md).
{% endhint %}

### Create a metric alert policy <a href="#create-a-metric-alert-policy" id="create-a-metric-alert-policy"></a>

To create a metric alert policy, do the following:

1. In Harness FME, create a new metric, or select a metric for which you want to create an alert policy. Go to [Create a metric](/feature-management-experimentation/use-fme/release-monitoring/metrics/setup/index.md#define-your-metric-name-and-information) for the metric creation steps.
2. On the metric's **Alert policy** tab, click **Create alert policy**.
3. Provide a name and description for the alert policy.
   * **Name**: Give your alert policy a recognizable name. Harness recommends including the name of the associated metric in the policy name.
   * **Description**: Optionally, give your alert policy a description. This can include anything useful to you and your team if an alert fires, such as runbooks, alerting protocols, and key information about the alert.
4. An alert policy can have multiple alert conditions. For each alert condition, fill in the fields as follows:
   * **Choose your environment**: Select the environment you want to apply the alert condition to. Each alert condition relates to a particular environment, and you are limited to one alert condition per environment. When you create additional alert conditions, any environment for which you have already configured an alert condition is not available in the environment menu list.
   * **Set alert threshold**: You can add a relative percentage threshold or an absolute value threshold. An alert fires when this threshold is exceeded in the degradation direction, which is the opposite of the desired direction of the metric. Go to [Choosing your degradation threshold for alerting](/feature-management-experimentation/use-fme/release-monitoring/alerts/alert-policies/monitoring-window.md#choosing-your-degradation-threshold-for-alerting) to select a threshold.

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If you set a degradation threshold of 0, Harness FME notifies you of observed impact in both the desired and the undesired directions.</p></div>
   * **Define alert notification channel**: Configure who to notify if an alert fires. By default, the metric owner is selected. You can also select the feature flag owners, any existing users and groups, and enter additional email addresses of your choice.
5. Click **Add alert condition** to add alert conditions for other environments.
6. After you finish entering your conditions, click **Create alert policy**. You now have a new alert policy.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Alert policies can only be created for metrics that are measured per traffic type, rather than those that are measured across all traffic type keys.</p></div>

### When a metric alert is triggered <a href="#when-a-metric-alert-is-triggered" id="when-a-metric-alert-is-triggered"></a>

When Harness FME identifies that a feature flag has caused a degradation in a metric, an alert is triggered for the metric alert policy, and the recipients you selected in the alert notification channel receive an email. The alert summary is also displayed on the Definition and Alerts tabs for the feature flag that caused the degradation.

When a metric alert is triggered, the recipients receive an email in the following format:

```
Subject: "Split Alert Fired: Feature Flag Name has caused Metric Name to degrade by X%"
Body: "Split has detected a degradation of X% on your Metric Name Metric. Here are the details:

Feature flag: (name and link to feature flag)
Alert Policy: (name and link to alert policy)
Metric: (name and link to metric)
Baseline Value:
Treatment Value:
Impact %:
Threshold %:
Please either kill the feature flag or dismiss this alert in the Split user interface.
-The Split Team

You are receiving this email because you were set as one of the people to be notified on this Alert Policy: (name and link to Alert Policy). If you don't want to receive these emails, please remove yourself from the list of people to be notified on the Alert policy page."
```

The alert notification email contains information about the specific feature flag version, rule, and treatment that triggered the alert, in comparison with the [baseline treatment](/feature-management-experimentation/use-fme/feature-management/manage-feature-flags/set-the-alert-baseline-treatment.md). In Harness FME, you can explore the results further on the Metrics impact page.

### Metric alert summary in Harness FME <a href="#metric-alert-summary-in-harness-fme" id="metric-alert-summary-in-harness-fme"></a>

When a feature flag causes a metric alert to trigger, a banner is displayed on the feature flag's Definition tab. Additional details are available on the feature flag's Alerts tab.

If an alert triggers, the following information is displayed in a table on the Alerts tab:

| Column header            | Description                                                                                                                                                                                                                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Alert fired              | Displays the timestamp when the metric alert is triggered. You can take action on the alert by clicking the menu list.                                                                                                                                                                    |
| Activity                 | Displays the status of the alert, whether it is dismissed or auto-resolved. Hover over the text to access the timestamp of the action in this column.                                                                                                                                     |
| Name of policy           | Displays the name of the metric alert policy. Click the name to go directly to the alert policy builder.                                                                                                                                                                                  |
| Rule                     | Displays the feature flag's targeting rule that caused the alert to fire.                                                                                                                                                                                                                 |
| Relative impact %        | Displays the degradation percentage that is detected and the error margin of this percentage. Hover over the text to access the timestamp of when the degradation is detected.                                                                                                            |
| Absolute impact          | Displays the degradation that is detected in an absolute value and the error margin of this value. Hover over the text to access the timestamp of when the degradation is detected.                                                                                                       |
| Metric value (baseline)  | Displays the metric value in absolute terms and the baseline treatment that is used for alert monitoring.                                                                                                                                                                                 |
| Metric value (treatment) | Displays the metric value in absolute terms, as well as the treatment that is used to compare against the baseline treatment for alert monitoring.                                                                                                                                        |
| Relative threshold %     | Displays the degradation threshold configured in the metric alert policy definition in relative terms, or a translation of the absolute threshold if that is used in the alert policy definition. Hover over the text to see which threshold type is used in the alert policy definition. |
| Absolute threshold       | Displays the degradation threshold configured in the alert policy definition in absolute terms, or a translation of the relative threshold if that is used in the alert policy definition. Hover over the text to see which threshold type is used in the alert policy definition.        |

For each alert, you can take the following actions:

| Action            | Description                                                                                                                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Kill feature flag | If you decide to kill a feature flag due to an alert, the [default treatment](/feature-management-experimentation/use-fme/feature-management/setup/default-treatment.md) overrides the existing targeting rules and is returned for all customers. |

### Troubleshooting metric alerts <a href="#troubleshooting-metric-alerts" id="troubleshooting-metric-alerts"></a>

Go to [Troubleshooting alerts](/feature-management-experimentation/use-fme/release-monitoring/alerts/troubleshooting.md) to diagnose an alert that did not fire as expected.

{% hint style="info" icon="diploma" %}
For an interactive onboarding experience including further use cases and features like **events**, **metrics**, and **monitoring and alerting**, go to the [**Harness Feature Management & Experimentation Advanced Feature Flagging for Engineers certification**](https://university-registration.harness.io/fme-level-2-advanced-feature-flagging-for-engineers).
{% endhint %}

{% @harness-feedback/feedback %}
