Alerts

Create an alert with multi-channel notifications

Each alert can send to multiple notification channels simultaneously.

The current server build wires these channel types:

TypeRequired config fields
webhookurl, optional method, headers, body_template
telegrambot_token, chat_id, optional message_template, parse_mode
slackwebhook_url, optional channel, username, icon_emoji

Each channel has an independent enabled flag so you can mute a channel without removing it.

post/alerts

Request body

namestring required
querystring required

SPL2 query executed on the schedule.

intervalstring required

Check frequency: 30s, 1m, 5m, 15m, 1h

enabledboolean

Example request

{
  "name": "High error rate",
  "query": "level=error | stats count as errors | where errors > 100",
  "interval": "5m",
  "channels": [
    {
      "type": "webhook",
      "name": "Slack Ops",
      "config": {
        "url": "https://hooks.slack.com/services/T00/B00/xxx"
      }
    }
  ]
}

Response

Alert created

Example response

{
  "data": {
    "id": "alt_xyz789",
    "interval": "5m",
    "channels": [
      {
        "type": "webhook",
        "name": "Slack Ops",
        "config": {
          "url": "https://hooks.slack.com/services/T00/B00/xxx"
        }
      }
    ]
  }
}

Changes