# Alerts Create alert rules to send an alert event when a [metric](https://docs.equinix.com/observability/streaming-data/metrics.md) crosses a defined threshold value. Alerts can trigger on both a `warningThreshold` and a `criticalThreshold`, triggering an alert event if the metric value falls below or exceeds the expected threshold. > **Note** > > In order to receive the event triggered by an Alert, you need to be able to receive events from a stream you have a subscription to in a sink of your choice. The events triggered by an Alert are not available in the Customer Portal or the API. To view the list of supported metrics, refer to the [Metrics](https://docs.equinix.com/observability/streaming-data/metrics.md) page. ## Creating an Alert[​](#creating-an-alert "Direct link to Creating an Alert") Prerequisite: In order to add an alert rule, you should have a stream created with Port and/or Connection resources attached and metric enabled * Portal * API 1. From the *Observability* menu, click **Data Streams**. 2. Select a Stream from the *Stream Inventory*. ![](https://docs.equinix.com/assets/images/stream-inventory-49d715a84f2a27ab0ad7065aa1b5a12c.png) 3. On the *Stream Details* page, from the *Actions* drop-down menu, click **Add Alerts**. ![](https://docs.equinix.com/assets/images/alerts-add-alert-d701c09d768421435f2fd8270e33d51e.png) 4. On the *Add Alert* page, enter your rule's parameters. * Select the Connection or Port Metric from the *Select a Metric* drop-down. * Give your Alert a name. * Add an Alert description (optional). * Select the operand value: `ABOVE` or `BELOW`. * Select a window size from the drop-down. * Set the value for triggering a warning event in the *Warning Threshold* field. * Set the value for triggering a critical event in the *Critical Threshold* field. ![](https://docs.equinix.com/assets/images/alerts-add-details-1260da4bcd4f5900148fd838e9078239.png) 5. Click **Next** 6. Select the Connection or Port to apply the Alert to from the list. ![](https://docs.equinix.com/assets/images/alerts-add-resources-9a1f936ea57fccc5f180adc048bf93c5.png) 7. Click **Submit**. From the confirmation screen, you can add more resources to your alert, add a subscription to your stream to receive your alert, or add another alert. To see the details of your new alert, click **View Alert Details**. ![](https://docs.equinix.com/assets/images/alerts-confirmation-56da2a51526d3a408d68aab8e685f88d.png) To create an alert, send a `POST` request to the [`/fabric/v4/streams/{streamId}/alertRules`](https://docs.equinix.com/api-catalog/fabricv4/stream-alert-rules/createstreamalertrules.md) endpoint. Sample cURL Request: ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//alertRules' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "METRIC_ALERT", "name": "", "description": "", "enabled": "true", "metricSelector": { "include": [ "equinix.fabric.port.bandwidth_tx.usage" ] }, "resourceSelector": { "include": [ "/fabric/v4/ports/780d384f-2eb6-4c07-ac89-ea106ca12814" ] }, "detectionMethod": { "type": "THRESHOLD", "operand": "ABOVE", "windowSize": "PT5M", "warningThreshold": 200000, "criticalThreshold": 300000 } }' ``` Sample Response: ``` { "href": "https://api.equinix.com/fabric/v4/streams/128cfe7c-e24f-4b1b-8a4f-680cd650c46c/alertRules/28da40d8-09bf-49f2-a02d-af34210f275e", "uuid": "128cfe7c-e24f-4b1b-8a4f-680cd650c46c", "type": "METRIC_ALERT", "name": "", "description": "", "state": "ACTIVE", "enabled": true, "metricSelector": { "include": [ "equinix.fabric.port.bandwidth_tx.usage" ] }, "resourceSelector": { "include": [ "/fabric/v4/ports/780d384f-2eb6-4c07-ac89-ea106ca12814" ] }, "detectionMethod": { "type": "THRESHOLD", "operand": "ABOVE", "windowSize": "PT5M", "warningThreshold": 200000, "criticalThreshold": 300000 } "changeLog": { "createdBy": "testuser", "createdDateTime": "2025-02-04T23:17:54.323427936Z" } } ``` ### Creating Smart Alerts - Latency[​](#creating-smart-alerts---latency "Direct link to Creating Smart Alerts - Latency") For Streams where you have [attached Metros](https://docs.equinix.com/observability/streaming-data/api-managing-assets.md), you can create smart alerts for latency thresholds. These AI-powered alerts analyze historical latency data across your metro locations using machine learning to establish baseline performance and generate smart alert thresholds, eliminating the need for manual alert configuration. * Portal * API To create a smart alert rule, follow the same steps for [Creating an Alert](#creating-an-alert), and: 1. Select the **Fabric Metro Latency** metric from the *Select a Metric* drop-down menu. 2. Give your alert a name and a description (optional). Click **Next**. ![](https://docs.equinix.com/assets/images/alerts-smart-latency-c42d0ce4f3d56c8da9eb3c2a622cebdc.png) 3. Select a Metro or Metros to apply a smart alert rule to. ![](https://docs.equinix.com/assets/images/alerts-smart-metro-afc211583d4ddce8b1c986af8654b5cf.png) 4. Click **Submit** Your alert appears in the list of alerts. ![](https://docs.equinix.com/assets/images/alerts-smart-list-4f495a14e11fe1257c1d0aff55e77dee.png) To create a smart alert rule, send a `POST` request to the [`/fabric/v4/streams/{streamId}/alertRules`](https://docs.equinix.com/api-catalog/fabricv4/stream-alert-rules/createstreamalertrules.md) endpoint. Specify the Metro-specific metric you are creating the alert for in the `metricSelector` object, the Metro that is attached to the stream that you are adding as a resource in the `resourceSelector` object, and specify the `detectionMethod.type` as `OUTLIER`. ``` curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams//alertRules' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "type": "METRIC_ALERT", "name": "", "description": "", "enabled": true, "metricSelector": { "include": [ "equinix.fabric.metro._.latency" ] }, "resourceSelector": { "include": [ "/fabric/v4/metros/{metro_code}" ] }, "detectionMethod": { "type": "OUTLIER" } }' ``` ## Retrieving Your Alerts[​](#retrieving-your-alerts "Direct link to Retrieving Your Alerts") * Portal * API To see the list of Alerts for a Stream: 1. From the *Observability* menu, click **Data Streams**. 2. Select a Stream from the *Stream Inventory*. ![](https://docs.equinix.com/assets/images/stream-inventory-49d715a84f2a27ab0ad7065aa1b5a12c.png) 3. Click on **Alerts**. ![](https://docs.equinix.com/assets/images/alerts-list-5524a9aad0ccf5b74a49a4966b74d92e.png) To get an alert's details, send a `GET` request to the [`/fabric/v4/streams/{streamId}/alertRules/{alertRuleId}`](https://docs.equinix.com/api-catalog/fabricv4/stream-alert-rules/getstreamalertrulebyuuid.md) endpoint. Sample cURL Request: ``` curl -X 'GET' 'https://api.equinix.com/fabric/v4/streams//alertRules/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` Sample Response: ``` { "href": "https://api.equinix.com/fabric/v4/streams/128cfe7c-e24f-4b1b-8a4f-680cd650c46c/alertRules/28da40d8-09bf-49f2-a02d-af34210f275e", "uuid": "128cfe7c-e24f-4b1b-8a4f-680cd650c46c", "type": "METRIC_ALERT", "name": "", "description": "", "state": "ACTIVE", "enabled": true, "metricSelector": { "include": [ "equinix.fabric.port.bandwidth_tx.usage" ] }, "resourceSelector": { "include": [ "/fabric/v4/ports/780d384f-2eb6-4c07-ac89-ea106ca12814" ] }, "detectionMethod": { "type": "THRESHOLD", "operand": "ABOVE", "windowSize": "PT5M", "warningThreshold": 200000, "criticalThreshold": 300000 } "changeLog": { "createdBy": "testuser", "createdDateTime": "2025-02-04T23:17:54.323427936Z" } } ``` ## Deleting an Alert[​](#deleting-an-alert "Direct link to Deleting an Alert") * Portal * API To delete an Alert: 1. From the *Observability* menu, click **Data Streams**. 2. Select a Stream from the *Stream Inventory*. ![](https://docs.equinix.com/assets/images/stream-inventory-49d715a84f2a27ab0ad7065aa1b5a12c.png) 3. Click on **Alerts**. 4. From the list of Alerts, click the options menu of the one you want to delete, click **Remove Alert**. ![](https://docs.equinix.com/assets/images/alerts-remove-fdea58374bc7c8af0e287139377896d9.png) To delete an Alert, send a `DELETE` request to the [`/fabric/v4/streams/{streamId}/alertRules/{alertRuleId}`](https://docs.equinix.com/api-catalog/fabricv4/stream-alert-rules/deletestreamalertrulebyuuid.md) endpoint. Sample cURL Request: ``` curl -X DELETE 'https://api.equinix.com/fabric/v4/streams//alertRules/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' ``` Sample Response: ``` { "href": "https://api.equinix.com/fabric/v4/streams/128cfe7c-e24f-4b1b-8a4f-680cd650c46c/alertRules/28da40d8-09bf-49f2-a02d-af34210f275e", "uuid": "28da40d8-09bf-49f2-a02d-af34210f275e", "type": "METRIC_ALERT", "name": "", "description": "", "state": "INACTIVE", "enabled": true, "metricName": "equinix.fabric.port.bandwidth_tx.usage", "resourceSelector": { "include": [ "*/ports/" ] }, "windowSize": "PT15M", "operand": "ABOVE", "warningThreshold": "43000000", "criticalThreshold": "45000000", "changeLog": { "createdBy": "testuser", "createdDateTime": "2025-02-04T23:17:54.323427936Z" } } ```