Create a monitor alert for the given conditions and monitor. We can create monitor alert either for model monitor or real-time monitor.
REQUIRED | KEY | TYPE | DESCRIPTION | ||||||
---|---|---|---|---|---|---|---|---|---|
Yes | projectId | str | Unique string identifier for the project. | ||||||
Yes | alertName | str | Name of the alert. | ||||||
Yes | conditionConfig | AlertConditionConfig |
Condition to run the actions for the alert.
|
||||||
Yes | actionConfig | AlertActionConfig |
Configuration for the action of the alert.
|
||||||
No | modelMonitorId | str | Unique string identifier for the model monitor created under the project. | ||||||
No | realtimeMonitorId | str | Unique string identifier for the real-time monitor for the deployment created under the project. |
KEY | TYPE | DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
success | Boolean | true if the call succeeded, false if there was an error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
result | MonitorAlert |
|
TYPE | WHEN |
---|---|
DataNotFoundError |
|
DataNotFoundError |
|
DataNotFoundError |
|
curl
curl "https://api.abacus.ai/api/createMonitorAlert" \
-X POST \
-H "apiKey: *******************"
-d
'{
"projectId": "",
"modelMonitorId": "",
"alertName": "test_alert",
"conditionConfig": "{\"alert_type\":\"AccuracyBelowThreshold\",\"threshold\":0.1}",
"actionConfig": "{\"action_type\":\"Email\",\"email_recipients\":[\"test@example.com\"]}"
}'
{
"success": true,
"result": {
"name": "test_alert",
"monitorAlertId": "",
"createdAt": "2023-11-30T01:59:46+00:00",
"projectId": "",
"modelMonitorId": "",
"conditionConfig": {
"threshold": 0.1,
"alert_type": "AccuracyBelowThreshold"
},
"actionConfig": {
"action_type": "Email",
"email_recipients": [
"test@example.com"
]
},
"conditionDescription": "Accuracy Is Below 10.00%",
"actionDescription": "Email: ['test@example.com']",
"alertType": "AccuracyBelowThreshold"
}
}
python
client.create_monitor_alert(
project_id='',
model_monitor_id='',
alert_name='test_alert',
condition_config='{"alert_type":"AccuracyBelowThreshold","threshold":0.1}',
action_config='{"action_type":"Email","email_recipients":["test@example.com"]}'
)
MonitorAlert(name='test_alert',
monitor_alert_id='',
created_at='2023-11-30T01:59:46+00:00',
project_id='',
model_monitor_id='',
condition_config={'threshold': 0.1, 'alert_type': 'AccuracyBelowThreshold'},
action_config={'action_type': 'Email', 'email_recipients': ['test@example.com']},
condition_description='Accuracy Is Below 10.00%',
action_description="Email: ['test@example.com']",
alert_type='AccuracyBelowThreshold',
latest_monitor_alert_version='')