Discord alerts: post Pingsured alerts to a Discord channel
Pingsured can post an alert to a Discord channel when a ping starts failing, when it recovers and when its certificate is replaced. It is a webhook that speaks Discord: you give Pingsured the URL of a Discord webhook, and every alert arrives as a message in that channel. Discord alerts are available on the same plans as webhooks, every paid plan. An account owner or manager sets them up, for a single ping or as a default for every ping of the account.
What you need
- A Discord server where you may manage webhooks (the Manage Webhooks permission), and the channel the alerts should go to. One webhook posts to one channel; to alert a second, create a second webhook.
Create the webhook in Discord
- In Discord open the channel's settings (the cogwheel next to its name) and go to Integrations, then Webhooks, and choose New Webhook.
- Give it a name and an icon if you like, for example Pingsured, and check that the channel is the right one.
- Choose Copy Webhook URL. It looks like
https://discord.com/api/webhooks/…/….
Discord changes the names of its menus now and then. What Pingsured needs is the URL of a webhook.
Treat the URL as a secret: whoever has it can post to that channel. Pingsured shows it in full only to owners and managers. If it leaks, delete the webhook in Discord and create another.
Add it in Pingsured
- For every ping, open Settings → Notifications, go to Integrations under Default notifications and choose the Discord card.
- For one ping, open the ping, go to its Notifications section, choose Add subscription and pick Discord.
Paste the webhook URL, all of it, token included. Pingsured accepts only the addresses Discord webhooks have (on discord.com, under /api/webhooks/), so a URL from another service, or one cut off before its token, is refused when you save it. Then choose the triggers. The recommended set is First error and First ok, with Certificate changed if you check certificates: you hear when something breaks and when it is fixed.
Choose Send test next to the channel to post a message marked as a test. It is the quickest way to find out that the URL and the channel are right before an alert depends on them.
What a message looks like
- A message with a headline made of the ping's name and a dot that shows its state, and a bar beside it to match: red when it is failing, yellow when it is degraded, green when it has recovered.
- The reason, when there is one: the HTTP status, the error, or why a content check failed.
- Where it was seen: either the location, such as
From de, or, for a ping checked from several, which of them are failing, such asFailing from de, sg (2 of 3 locations). - A link, View ping in Pingsured, that opens the ping.
A certificate change reads Certificate changed on the ping, or Unexpected certificate on it when something about the change is not what a renewal looks like, with the reasons beneath.
Messages never ping anyone: a ping named @everyone, or an error text with a mention in it, is shown as text and notifies nobody beyond what the channel's own settings do for a new message.
The language of the messages
Messages are written in the account's notification language, which an owner sets under Settings → Account. The messages come in English, German, Spanish, French and Italian. Until it is set they are in English. The same setting is the fallback language for alert emails to members who have not chosen one of their own. The reason line is shown as the checked service reported it, in whatever language that is.
When messages are sent
A Discord channel follows the same rules as every other alert channel: which changes, how many failures first, how often and from where are described in the notifications page. A change of status is always sent at once, and repeat alerts for the same ping and channel are held back for 15 minutes.
If a message does not arrive
When Discord cannot be reached, rate limits the request or answers with an error that may pass, the delivery is retried, 5 attempts in all, 30 seconds, 5 minutes, 30 minutes and 2 hours apart. Any other answer is final, and Pingsured shows what Discord said when you hover over the status badge next to the channel in Settings → Notifications. The usual one is Unknown Webhook: the webhook was deleted in Discord. The fix is a new webhook: create it in Discord, add it in Pingsured and remove the old one.
Limits
- Discord channels count with webhooks toward the same limits: 50 account-wide and 20 on one ping.
- Messages are posted under the name and icon the webhook has in Discord. Mentions and direct messages are not available yet.