Docs
Rules and notifications
A rule
A rule is a query and its thresholds. Each series of the answer is judged on its own: one series past a threshold is one alert.
| Field | Meaning |
|---|---|
| Reads | Metrics (Mimir, PromQL) or Logs (Loki, a LogQL metric query such as sum by (app) (count_over_time({…} |= "error" [5m]))) |
| Tenant | The tenant of Mimir or Loki to ask |
| Query | Up to 4000 characters; it should return one series per thing to alert on |
| Condition | >, >=, < or <= |
| Warning, Critical | Either or both; Critical must be past Warning |
| Unit | %, s, /s, count, or state (a yes or no: the number is not shown) |
| Max | For a rule in %: the query is the amount used and Max the most there can be; the message tells both, as 97.1% (7.8 GiB / 8 GiB) |
| Evaluate every | 15 seconds to 1 hour |
| Wait before opening | The series must stay past the threshold this long (up to 24 hours) |
| Hysteresis | How far back past the threshold an open alert must come before it steps down or closes, so a number that wanders around the threshold does not open and close it again and again |
| No data | When the series is gone: close the alert, or keep it open |
| Only these series | A scope by label: node=runner-*, namespace!=kube-*; the same label is "or", different labels are "and"; up to 20 |
| Send to | Channels for this rule only; empty sends each alert where its kind goes (below) |
A rule matches at most 500 series; a wider one is a sign the query should be grouped.
Before turning a rule on
- Preview asks the query now and shows every series with its level.
- Backtest replays the last 7 days (1 day for Loki) with the thresholds, the wait and the hysteresis, and tells how many times the rule would have opened, how many of those were Critical, how many closed within 15 minutes, and the noisiest series.
- The Health tab lists the noisiest rules of the last 7 days with a hint (raise the threshold, wait longer, add hysteresis), and can backtest every rule that is off at once.
The library
Add recommended rules adds ready rules (75 in all) for each tenant you pick, named <rule> (<tenant>), turned off. A rule whose
metrics the tenant does not have is skipped and the reason is shown.
| Group | Examples |
|---|---|
| Servers | CPU, memory and disk high, a disk full soon or read-only, a server not reporting or rebooted, swap, clock out of sync, kernel OOM kill, file descriptors |
| Kubernetes | CrashLoopBackOff, image pull, OOMKilled, pods pending, Deployment down or stuck, HPA at its maximum, volumes almost full, node not ready, cluster out of room, an Ingress or route with no healthy backend, cert-manager certificates |
| MongoDB | Down or restarted, no primary, a member not healthy, an election, replication lag, a short oplog window, tickets, queued operations, connections |
| Docker | Containers restarting, OOM-killed, near the memory limit, stopped (cAdvisor of a VM) |
| Logs | Connection errors and crash errors in logs, 5xx through Envoy Gateway and nginx, logs that stopped |
| Domains | A domain answering 5xx or failing, a certificate close to expiry (blackbox exporter) |
| Argo CD | An application Missing or Degraded, out of sync |
Incidents
Alerts that belong together are told as one incident:
- Parent and child. An alert whose labels are all in another's holds it: a node holds the pods on it, a workload its pods, a VM the MongoDB member on it, a replica set its members, a pod the error lines of its app in Loki. Pods of one workload that fail together are one incident too.
- Grouping. When 3 or more series of one rule open within 30 seconds, they go out as one message that lists every one of them, the worst first.
On Telegram, the parent's message is edited to list its children as they open and recover, so the phone rings once. Recoveries and reminders are replies in the thread of the first message. Alerts of logs still ring at once, as replies.
Where an alert goes
Without Send to on the rule, an alert goes to the channels that listen to its kind:
| Kind (from its labels) | Catalog of the channel |
|---|---|
pod, workload, persistentvolumeclaim, node with cluster, cluster |
Kubernetes |
node without cluster, and the containers of a VM |
VM |
cluster_name (MongoDB) |
MongoDB |
| A probe of the blackbox exporter | Domains and SSL |
| A rule of Loki | Logs |
A channel can also be limited to some rules (NODE-*, a rule ID) and to some namespaces (billing, payments-*), and to
Critical only or Warning and Critical.
Channels
| Option | Meaning |
|---|---|
| Minimum severity | Critical, Warning and Critical, or "No alerts, only the daily summary" |
| Resolved | Send a message when an alert recovers |
| Log summary | After the alert of a pod, a reply with its log lines from Loki, grouped |
| Daily summary | At the time you set: what is open, what opened and what closed in the last 24 hours |
| Backup | Receives a copy of what another channel could not send |
| Paused | Sends nothing for now |
Silences and snoozes
- Silence an alert from its finding or a message: by rule and labels, with a reason and an end (1 hour to 90 days). Matching alerts open but are not told until the silence ends.
- Snooze a finding for 24 hours, or Ignore it, from the Findings page.