---
title: Alerts and rules
description: How ZevSight alert rules work for logs, uptime checks and heartbeats, the alert lifecycle, and how to acknowledge, resolve and snooze.
url: https://docs.zevsight.com/respond/alerts
---

# Alerts and rules

> How ZevSight alert rules work for logs, uptime checks and heartbeats, the alert lifecycle, and how to acknowledge, resolve and snooze.

An **alert rule** watches a condition. When the condition holds long enough, the rule opens an **alert**. The alert runs an [escalation policy](/respond/escalation) to notify people and [channels](/respond/channels), and opens an [incident](/respond/incidents) with a timeline. Manage rules on the dashboard's **Alerts** page.

## Rule kinds

| Kind | Fires when | Created |
|---|---|---|
| **Check** | An [uptime check](/monitor/uptime-checks) is down (or down or degraded) | Automatically, one per check |
| **Heartbeat** | A [heartbeat](/monitor/heartbeats) is late, failed, or either | Automatically, one per monitor |
| **Log** | The number of matching log lines in a window crosses a threshold | By you |

You can also **declare** an alert by hand, for example when a customer reports a problem first. A declared alert runs an escalation policy like any other.

## Check and heartbeat rules

These rules come with every check and heartbeat. You can edit or pause them.

- **Check rules** fire on `down` by default, after the state holds for 60 seconds. Choose **down or degraded** to also be told about slow responses and certificates near expiry.
- **Heartbeat rules** fire on `late` and `fail` straight away (the grace period is the delay). They arm only after the first ping.

## Log rules

A log rule counts lines that match a [query](/explore/search-syntax) over a sliding window:

```text
query      service:checkout level:>=error
window     5 minutes
condition  count > 20
```

| Setting | Range |
|---|---|
| Query | Up to 2,000 characters, the explorer's syntax |
| Window | 1 to 60 minutes |
| Evaluated every | 30 seconds to 60 minutes, no longer than the window. The dashboard uses one minute. |
| Condition | `>`, `>=`, `<`, `<=` or `==` a whole number from 0 to 1,000,000,000 |
| Scope | Some projects or all, optionally limited to environments or service environments |

The alert's cause reads like "23 lines in the last 5m (> 20): service:checkout level:>=error". Log rules are not grouped by field: one rule has at most one open alert. To alert per service, create one rule per service. Some plans do not include log alerts.

## Timing

| Setting | Meaning | Default |
|---|---|---|
| Wait before starting (`for`) | The condition must hold this long before the alert opens | 60 s for checks, 0 for heartbeats and log rules |
| Resolve after | The condition must be clear this long before the alert resolves | 0 for checks and heartbeats; the window for log rules |
| Cooldown | If the rule fires again within this time, the same alert reopens instead of a new one | 5 minutes |

Each can be up to 24 hours.

## Severity

| Severity | Use for |
|---|---|
| `sev1` Critical | Customers cannot use the product |
| `sev2` Major | A core feature is broken |
| `sev3` Minor | Degraded, with a workaround |
| `sev4` Low | Cosmetic or internal only |

Log rules default to `sev2`. A declared alert defaults to `sev3`.

## Lifecycle

```text
ok ──(condition holds for "for")──▶ firing ──▶ acknowledged ──▶ resolved
                                       │                            ▲
                                       └──(condition clears)────────┘
```

- **Firing.** Escalation runs and reminders are sent.
- **Acknowledged.** Someone is on it. Escalation stops.
- **Snoozed.** Reminders and escalation pause for 5 minutes to 24 hours. Steps that fall due meanwhile run when the snooze ends. Snoozing again replaces the end time. The alert stays open.
- **Resolved.** Either the condition cleared (recorded as *recovered*) or someone resolved it. If you resolve while the condition still holds, the alert opens again after the rule's wait.

A rule has at most one open alert at a time.

## Acknowledge, resolve and snooze

From the dashboard, the alert email (the **Acknowledge** button opens a confirmation page and acknowledges as you), Slack's **Open incident** link, ZevThread's card buttons, or the API:

```bash
# list open alerts
curl https://eu.zevsight.com/v1/alerts -H "Authorization: Bearer <API_KEY>"

# acknowledge, resolve, snooze
curl -X POST https://eu.zevsight.com/v1/alerts/<ALERT_ID>/acknowledge -H "Authorization: Bearer <API_KEY>"
curl -X POST https://eu.zevsight.com/v1/alerts/<ALERT_ID>/resolve     -H "Authorization: Bearer <API_KEY>"
curl -X POST https://eu.zevsight.com/v1/alerts/<ALERT_ID>/snooze \
  -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" -d '{"minutes": 30}'
```

Changing an alert needs a member, admin or owner, or an API key with the **respond** permission. Viewers and read-only keys get `403`. See the [Alerts API reference](/api/reference/alerts).

> **Note: Maintenance mutes alerts**
>
> During a status page [maintenance window](/status-pages/reports-and-maintenance#maintenance) that covers a check or heartbeat and mutes alerts, its alerts are recorded but nobody is paged. Escalation starts when the window ends if the problem is still there.

## Runbooks

Each rule can carry one runbook link, shown on every notification and on the incident. See [Runbooks](/respond/runbooks).
