Skip to content

10.1Add an alert channel

You manage channels under alerting → channels. Selecting alerting in the top navigation opens channels first.

  1. Select alerting, then channels.
  2. Select + new channel. If your team has no channels yet, select + add a channel instead. The New alert channel panel opens.
  3. Choose a type. Slack is selected when the panel opens. The types are listed in the table below.
  4. Enter a Name you will recognise later, for example ops-team.
  5. Fill in the fields for the type. Sections 10.2 to 10.8 describe them.
  6. Select Create channel. The button stays greyed out until the name and the required fields are filled in and look correct.

Credential fields, such as URLs, tokens and keys, are hidden while you type. Select show next to a field to check what you typed. When the channel is created, the panel closes and the new channel opens in the editor. The editor does not show the credentials again (10.10). If something is wrong, the error shows in red at the bottom of the panel. Select Cancel or press esc to close the panel without saving.

TypeWhat you needSection
EmailOne email address10.2
SlackA Slack incoming webhook URL10.3
Microsoft TeamsA Teams Workflows URL10.4
DiscordA Discord channel webhook URL10.5
TelegramA bot token and a chat ID10.6
PagerDutyA PagerDuty Events API V2 integration key10.7
PushoverA Pushover application API token and a user key10.11
WebhookAn https:// URL on your own system10.8

Attach the channel to monitors#

A channel gets alerts only from the monitors it is attached to. You can attach it in two places:

  • In the channel editor. Under pages these monitors, select a monitor to attach it. Select it again to detach it. Each change is saved at once.
  • In the monitor form. Under on failure — notify, select the channels this monitor should alert. This block appears only when your team has at least one channel.

If a monitor has no channels, its page warns: "No alert channels — a failure here pages nobody". The overview also shows "No notification channel — alerts have nowhere to go." when your team has monitors but no channels.

Rules for all channels#

  • The Name is required. It cannot contain line breaks or other control characters.
  • A team can have at most 200 alert channels. From 80% of that, the dashboard shows a banner with your count. At 200, delete a channel you no longer use before you add a new one.
  • Every URL (Slack, Teams, Discord and Webhook) must start with https://. Otherwise the form shows Must be an https URL. It can be at most 8192 bytes long. It must point to a public address, not to a private or internal network.

When a value is refused, the message starts with invalid input: and names the field. For example: invalid input: slack_webhook_url must be an https URL. Before you save, the dashboard also shows "Must be an https URL" under a URL field that does not start with https://.

Use the API#

Each type has its own create call in MonitorConfigService. Each call returns the new channel as {"channel": {...}}. Chapter 13 shows how to create an API key and make requests.

TypeCallFields
EmailCreateEmailChannelname, emailTo
SlackCreateSlackChannelname, slackWebhookUrl
Microsoft TeamsCreateTeamsChannelname, teamsWebhookUrl
DiscordCreateDiscordChannelname, discordWebhookUrl
TelegramCreateTelegramChannelname, telegramBotToken, telegramChatId
PagerDutyCreatePagerDutyChannelname, pagerdutyRoutingKey, optional pagerdutyEu
PushoverCreatePushoverChannelname, pushoverUserKey, pushoverAppToken
WebhookCreateWebhookChannelname, webhookUrl, optional webhookHeaders, webhookSecret
Set these once (used by the examples in this chapter)
bash
export OBSRVLY_KEY=obs_...
export OBSRVLY_API=https://www.obsrvly.com/api/gw
Create a Slack channel
bash
curl -s \
  "$OBSRVLY_API/monitor/obsrvly.v1.MonitorConfigService/CreateSlackChannel" \
  -H "Authorization: Bearer $OBSRVLY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "ops-team",
       "slackWebhookUrl": "https://hooks.slack.com/services/..."}'
  • ListAlertChannels returns channels and nextCursor. Send limit (default 50, at most 200) and cursor for the next page.
  • GetAlertChannel takes the channel id.
  • To attach channels to a monitor, call UpdateMonitor with alertChannelIds and replaceAlertChannels: true. Without replaceAlertChannels: true, the list is ignored.
  • A monitor can only use channels of its own team. Otherwise you get invalid input: alert_channel_ids contains a channel this team doesn't own.
  • At the 200-channel limit, create calls fail with team channel limit reached: a team can hold at most 200 alert channels; delete one it no longer uses.

Last updated