Add a channel
1
Open the channel form
Open a site, then Alerts in the sidebar. Under Notification channels, select Add channel.
2
Choose where alerts go
In Where, pick Email, Slack, Discord, Telegram or Webhook. The kind of a channel cannot be changed later.
3
Name it and enter the destination
Give the channel a Name of up to 80 characters, such as
#alerts on Slack. It is how the channel appears in alert rules. Then enter the destination for that kind, described below.4
Save and test
Select Add channel, then Send test next to it. The test arrives within about a minute. See test a channel.
hooks.slack.com/…. When you edit such a channel, the field starts empty: leave it empty to keep the saved URL, or paste a new one to replace it.
Destinations
Slack
In Slack, create an incoming webhook for the channel you want alerts in, and paste its URL. Each notice is a message with:- the headline as a header and the summary,
- up to 10 facts as fields, and the list of new errors or goals when there is one,
- an Open dashboard button,
- a footer with the rule name and a Change or mute this alert link.
Discord
In Discord, open the channel’s settings, then Integrations, Webhooks, and copy the webhook URL. Each notice is posted as CrispStats with one embed:- the headline linking to the dashboard, and the summary with Open dashboard and Change or mute this alert links,
- up to 20 facts as fields, and the list of new errors or goals when there is one,
- a color for the tone: red for problems, green for good news such as payments and recoveries, orange otherwise,
- the rule name in the footer and the time it fired.
@everyone.
Telegram
CrispStats posts to Telegram through one bot that the CrispStats deployment owns. You do not create a bot or paste a bot token: the channel stores only a chat id. Which bot. The bot is the one registered with Telegram’s@BotFather when CrispStats is deployed. Its token is a deployment secret, TELEGRAM_BOT_TOKEN, read by the ingest worker, never by your browser or your site. The bot’s username is chosen at that point, so it is a deployment setting and not a fixed name: neither the channel form nor these docs show it yet. Ask your CrispStats contact or support for the bot’s username before you set up the channel.
Let the bot post. Telegram bots can only write where they are allowed to:
- a private chat: open the bot in Telegram and select Start once,
- a group: add the bot to the group,
- a channel: add the bot to the channel as an administrator that can post messages.
-, such as -1001234567890) or a public channel’s @name (4 to 64 letters, digits or underscores after the @). Anything else is refused when you save.
Each notice is a message with:
- the headline in bold and the summary,
- up to 12 facts and up to 10 list items,
- a Change or mute this alert link and an Open dashboard button.
Bad Request: chat not found. If the deployment has no TELEGRAM_BOT_TOKEN set, every Telegram delivery fails with Telegram is not configured on this deployment (TELEGRAM_BOT_TOKEN); that is fixed on the deployment, not in the channel.
Webhook
CrispStats sends a JSONPOST to your endpoint for every notice, signed with the channel’s own secret. Use it to feed alerts into your own tools.
The request carries these headers:
This is the body of a Monitor down notice:
Answer with any
2xx status. To check that a request came from CrispStats, verify the signature over the raw body and reject timestamps more than 300 seconds from now. See webhook signatures.
URL rules
Before each delivery, CrispStats checks the destination again:- Slack URLs must be on
hooks.slack.comorhooks.slack-gov.com, and Discord URLs on the Discord hosts listed above. A Slack or Discord channel cannot point anywhere else. - Every URL must use
httpson the default port 443, without a user name or password. - Webhook URLs must not be, or resolve to, a private, loopback, link-local or metadata address or an internal host name. The host is looked up and its addresses checked before the request (a successful lookup is reused for up to 5 minutes), and a failed lookup fails the delivery.
- Redirects are not followed. A
3xxresponse counts as a failed delivery.
Delivery and retries
Each request waits up to 8 seconds for an answer. A429 or 5xx response is retried once, after the Retry-After the destination asks for (up to 5 seconds) or after a short pause. Timeouts and network errors are not retried, because the notice may have arrived and a duplicate is worse than a gap. Each delivery, with its status and error, is listed in Recent deliveries on the Alerts screen.
Errors stored in the log never contain your webhook URLs or tokens.
Turn off or remove a channel
- Use the switch next to a channel to stop sending to it from every site. Rules keep it ticked, and sending resumes when you switch it back on. A channel that is off cannot be tested.
- Open the actions menu (⋯) and choose Remove channel to delete it. Alerts on every site in the workspace stop sending to it; the rules themselves stay.
Next steps
Get alerted
Create a rule and attach your channels.
Alert rule types
What each rule watches and what its notice contains.
Webhook signatures
Verify that a request came from CrispStats.