Skip to main content

Managing Metric Alert Rules

The Stream Alert Rule Management APIs offer a method to send an alert event to a Sink Type when a metric crosses a defined threshold value. The Metric Alert Rule can define both a warningThreshold and a criticalThreshold, which will trigger a metric alert event if the metric value falls below or exceeds the expected threshold.

Once you create a Metric Alert Rule, you will receive an event when the threshold value is crossed. For the example below, an alert event was raised when the Port Bandwidth Transmitted (tx) Rate exceeded the warning threshold. An additional alert event would have been raised if the Port Bandwidth Transmitted (tx) Rate exceeded the critical warning. Once the transmitted rate falls below the warning threshold, a clear metric alert event would be generated.

To view the list of supported metrics, refer to the API Reference and Related Resources Section.

Creating a Metric Alert Rule

To create a metric alert rule, send a POST request to the /fabric/v4/streams/{streamId}/alertRules endpoint.

Sample cURL Request:

curl -X 'POST' 'https://api.equinix.com/fabric/v4/streams/<streamId>/alertRules' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>' \
-d '{
"type": "METRIC_ALERT",
"name": "<alert_rule_name>",
"description": "<alert_rule_desc>",
"enabled": "true",
"metricName": "equinix.fabric.port.bandwidth_tx.usage",
"resourceSelector": {
"include": [
"*/ports/<uuid>"
]
},
"operand": "ABOVE",
"windowSize": "PT15M",
"warningThreshold": "10000000",
"criticalThreshold": "15000000"
}'

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": "<alert_rule_name>",
"description": "<alert_rule_name>",
"state": "ACTIVE",
"enabled": true,
"metricName": "equinix.fabric.port.bandwidth_tx.usage",
"resourceSelector": {
"include": [
"*/ports/<uuid>"
]
},
"windowSize": "PT15M",
"operand": "ABOVE",
"warningThreshold": "43000000",
"criticalThreshold": "45000000",
"changeLog": {
"createdBy": "testuser",
"createdDateTime": "2025-02-04T23:17:54.323427936Z"
}
}

Retrieving a Metric Alert Rule

To get a metric alert rule details, send a GET request to the /fabric/v4/streams/{streamId}/alertRules/{alertRuleId} endpoint.

Sample cURL Request:

curl -X 'GET' 'https://api.equinix.com/fabric/v4/streams/<streamId>/alertRules/<alertRuleId>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>'

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": "<alert_rule_name>",
"description": "<alert_rule_name>",
"state": "ACTIVE",
"enabled": true,
"metricName": "equinix.fabric.port.bandwidth_tx.usage",
"resourceSelector": {
"include": [
"*/ports/<uuid>"
]
},
"windowSize": "PT15M",
"operand": "ABOVE",
"warningThreshold": "43000000",
"criticalThreshold": "45000000",
"changeLog": {
"createdBy": "testuser",
"createdDateTime": "2025-02-04T23:17:54.323427936Z"
}
}

Deleting a Metric Alert Rule

To delete a Metric Alert Rule, send a DELETE request to the /fabric/v4/streams/{streamId}/alertRules/{alertRuleId} endpoint.

Sample cURL Request:

curl -X DELETE 'https://api.equinix.com/fabric/v4/streams/<streamId>/alertRules/<alertRuleId>' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Bearer Token>'

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": "<alert_rule_name>",
"description": "<alert_rule_name>",
"state": "INACTIVE",
"enabled": true,
"metricName": "equinix.fabric.port.bandwidth_tx.usage",
"resourceSelector": {
"include": [
"*/ports/<uuid>"
]
},
"windowSize": "PT15M",
"operand": "ABOVE",
"warningThreshold": "43000000",
"criticalThreshold": "45000000",
"changeLog": {
"createdBy": "testuser",
"createdDateTime": "2025-02-04T23:17:54.323427936Z"
}
}