# Alerts that follow your rules

> Alert rules for the whole company, a group or one monitor, several thresholds per rule, and channels from Slack and Discord to SMS, push and webhook.

An alert rule answers three questions: which monitors it applies to, when it fires and where it sends the message. The easiest way to see it is one concrete rule, which we take apart below.

## Example: a rule for versiontwo.sk

We want to know about an outage right away and, if it lasts longer, call in more people. One rule with two thresholds covers it.

### What you configure

- **Scope:** `monitor` – only the versiontwo.sk monitor
- **Threshold 1:** Events `monitor.down` and `monitor.up`, `min_outage_seconds` = 0. Channels: Discord and push.
- **Threshold 2:** Event `monitor.down`, `min_outage_seconds` = 300. Channel: SMS to your team's phone numbers.
- **Spam protection:** `debounce_seconds` on a threshold (default 10): sending is delayed by that many seconds from outage confirmation. If the monitor returns to UP in the meantime, the outage message is not sent. For a threshold with `min_outage_seconds`, the longer of the two times applies.

### What happens

- 0:00 – **The monitor goes DOWN.** Upstat first confirms the outage according to the stabilization settings (`consecutive_failures` and `min_down_seconds`). Then it opens an incident and evaluates the rules that apply to the monitor. Times on thresholds are counted from this confirmation, not from the first failed check.
- 0:00 – **Threshold 1 fires immediately.** Once `debounce_seconds` have passed, an outage message goes to Discord and as a push to the Upstat mobile app.
- 5:00 – **Threshold 2: the outage continues.** When the outage lasts at least `min_outage_seconds` and the monitor is still DOWN, an SMS goes to your team's numbers and one SMS credit is deducted. If the monitor returns to UP before that, no SMS is sent and no credit is deducted.
- **The monitor is UP again.** Threshold 1 also contains the `monitor.up` event, so a recovery message goes to Discord and as a push.

## Rule scope

The scope decides which monitors a rule covers. `company` applies to every monitor in the company, `group` only to monitors in one group and `monitor` to a single monitor.

Rules add up. If a monitor falls under a company rule and under the rule of its group, both apply and their thresholds are evaluated separately.

## Channels

A channel is a connection that you pick in a threshold as the destination of a message. A threshold can use several channels at once if your plan allows them.

- Slack
- Discord
- Telegram
- E-mail
- SMS
- Push to the Upstat mobile app
- Webhook (HTTP POST)
- ntfy

SMS messages use SMS credits. Free SMS every month by plan: Pro: 15.

## Common questions about alerts

### Will I get a message when the service recovers?

Yes, if the threshold contains the monitor.up event. In the example above threshold 1 contains it, so the recovery message goes to its channels.

### What happens when the outage ends before min_outage_seconds elapses?

The message of the threshold with the longer outage time is not sent. Example: if the monitor returns to UP before the fifth minute, the SMS from threshold 2 does not arrive, but the Discord and push messages from threshold 1 went out immediately.

### Can one rule send messages through several channels?

Yes. A threshold has a list of channels and the message goes to each of them. One rule can also have several thresholds, each with different events, outage time and channels.

## What your customers see

Alerts go to you and your team. You show customers the state on a public status page, where they see what is going on and can subscribe to updates.

- [See what a status page looks like](https://upstat.sk/en/status-pages)
