# Create a metric alert

Metric monitors analyze continuous streams of data. When collecting metrics through Kloudfuse or APIs, you can configure alerts to trigger on specified conditions.

To create a metric alert, complete these tasks:

- [Begin defining a metric alert](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#alert)
- [Choose the detection method](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#detection)
- [Pick metric](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#pick)
- [Set condition](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#condition)
- [Add details](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#details)
- [Add contacts](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#contacts)
- [Create rule](https://docs.kloudfuse.com/platform/3.4.0.p1/alerts-create-metric/#create-rule)

## Start defining a metric alert

1. In the **Alerts** interface, click .
2. In the initial interface for creating alerts, Kloudfuse guides you to select the appropriate alert type. Choose **Metric**.
3. The **Create Metric Alert** interface appears.

## Choose the detection method

Metric alerts have these detection options:
- Threshold alert
- Change alert
- Outliers alert
- Anomaly detection
- Forecast Alert

## Pick metric

1. Next to the first query, marked by , click the text field to select a metric from the drop-down.

## Work with filters

1. To add a new filter, select a label and add it to the metric view.
2. In the expanded view, click the first  option, and choose the new label from the drop-down.
3. Choose the comparison operator: 
   - `=~` Regex expression equal
   - `!~` Regex expression not equal
   - `!=` Not equal
   - `=` Equal (default)
4. Finally, click the second  option to choose the label value from the drop-down.

## Work with aggregations

1. In the **aggregation** section, click **avg**, and select another aggregation calculation from the drop-down.
2. The chart changes to show the newly selected aggregation of results.

## Work with functions

1. To add a new function to the graph, click the  icon.
2. In the drop-down, either search for a function name, or select an existing function category, and then pick the function name.

## Work with queries

1. To add a query, click .
2. Notice that a new query  appears under query .
3. Change the selected filter in query .

## Work with formulas

1. To add a formula, click .
2. The empty formula option appears in interface as line .
3. Type the formula in the text box next to label .

## Set condition

1. Define the condition depending on the detection method:
   - Threshold Alert
   - Change Alert
   - Outliers Alert
   - Anomaly Detection Alert
   - Forecast alert

Example: **Condition for Threshold Metric Alerts** - Select a condition function: **Mean**, **Min**, **Max**, **Sum**, **Count**, or **Last** (default).

2. Select the evaluated query or formula.
3. Select the comparison operator: **above**, **below**, etc.
4. Specify the time interval.

## Add details

1. In the **Folder name** drop-down, select one of the folders or create a new folder.
2. In **Rule name**, specify the name of your rule.
3. Optionally, add a title, runbook URL, description, and custom labels.

## Add contacts

1. Choose one or more existing contacts from the drop-down to receive the alert.
2. You can create new contact points by clicking on **Create New Contact Points** and following the configuration steps.

## Create rule

1. To finalize, click **Create Rule**.
2. After reviewing the selection, click **Confirm and Create** to receive a confirmation message.
