Alerts
Create/Update Alert
Create a new alert based on the provided configuration or update an existing one if the alert.metadata.id matches an existing alert.
POST
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Alert to create or update
Request to create a new alert or update an existing one. If alert.metadata.id is provided and matches an existing alert, that alert will be updated.
Example:
{
"metadata": {
"name": "name",
"description": "description",
"id": "123e4567-e89b-12d3-a456-426614174000"
},
"timeseries": {
"expression": {
"metoroQLTimeseries": {
"query": "count(traces)",
"bucketSize": 60
}
},
"evaluationRules": [
{
"static": {
"persistenceSettings": {
"datapointsToAlarm": 3,
"missingDatapointBehavior": "notBreaching",
"datapointsInEvaluationWindow": 5
},
"operators": [
{
"threshold": 5000,
"operator": "greaterThan"
}
]
},
"name": "name",
"type": "static",
"actions": [
{
"slackDestination": { "channel": "my-alerts-channel" },
"type": "slack"
},
{
"emailDestination": {
"emails": ["user@example.com", "admin@example.com"]
},
"type": "email"
}
]
}
]
},
"type": "timeseries"
}
Response
200
application/json
Alert created or updated successfully
Unique identifier for the created or updated alert
Was this page helpful?