Alerts and routing#
This page lists the alert rules the library ships, the stock rules it changes, and the Alertmanager configuration it generates. Your own application alerts are not part of the library; see Add application dashboards and alerts.
Stock kube-prometheus-stack rules#
The stack keeps the default rule set of the kube-prometheus-stack chart, with these exceptions.
Change |
Effect |
|---|---|
|
The stock |
|
The stock |
|
The stock |
|
No kube-proxy scrape target and no stock |
|
No etcd scrape target and no stock etcd alerts. |
|
No kube-controller-manager scrape target and no stock |
|
No kube-scheduler scrape target and no stock |
Shipped rule groups#
The kube-prometheus-stack HelmChart carries three additional rule groups through additionalPrometheusRulesMap.
They are always present.
job-health#
Alert |
Severity |
For |
Fires when |
|---|---|---|---|
|
|
15m |
The last scheduled run of a CronJob is newer than its last successful run, and the CronJob has no active Job. |
|
|
15m |
A Job that no CronJob owns has the condition |
|
|
1h |
A container waits for a reason other than |
KubeCronJobLastRunFailed resolves with the next successful run.
KubeJobFailed resolves when the Job is deleted or re-run successfully.
KubeContainerWaiting ignores pods in phase Failed or Succeeded.
node-memory#
Alert |
Severity |
For |
Fires when |
|---|---|---|---|
|
|
15m |
A node has more than 500 major page faults per second over 5 minutes, and its tasks spent more than 1 % of the last 15 minutes waiting for memory ( |
The memory pressure condition needs the pressure collector of the node exporter, which is on by default on Linux 4.20 and later.
pdb-drain-safety#
The group evaluates every minute. Both rules select PodDisruptionBudgets that allow zero voluntary disruptions and expect at least one pod.
Alert |
Severity |
For |
Labels |
|---|---|---|---|
|
|
15m |
|
|
|
1h |
|
Both rules exclude these PodDisruptionBudgets:
every PodDisruptionBudget in the namespace
longhorn-systemevery PodDisruptionBudget whose name ends in
-primary
Opt-in rule groups#
longhorn.volume-health#
The longhorn-volume-health PrometheusRule exists only when longhorn.enabled and longhorn.alerts are both true.
Alert |
Severity |
For |
Expression |
|---|---|---|---|
|
|
1m |
|
|
|
10m |
|
The metric longhorn_volume_robustness takes the values 0 (unknown), 1 (healthy), 2 (degraded), and 3 (faulted).
Alert labels#
Prometheus adds the external label cluster with the value of clusterName to every alert.
Prometheus drops the external label replica from alerts through additionalAlertRelabelConfigs.
Metrics keep the replica label for Thanos deduplication.
Routing tree#
The root route has these settings.
Setting |
Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
Alertmanager evaluates the child routes in this order and stops at the first match.
Order |
Matcher |
Receiver |
|---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
Route 7 exists only when stagingAlerts.enabled is true.
With deadMansSwitch.enabled, route 1 also sets group_wait: 0s, group_interval: 1m, and repeat_interval from deadMansSwitch.repeatInterval.
Every alert that matches no child route goes to email.
Receivers#
nullDiscards the notification.
emailSends to every address in
smtp.recipients, or tosmtp.fromwhensmtp.recipientsis unset. Sends resolved notifications as well. Adds every entry ofsmtp.headersas a mail header.stagingExists only when
stagingAlerts.enabledis true. Sends to the same addresses asemail, with resolved notifications. Sets the subject to[STAGING]followed by the default subject, and adds every entry ofsmtp.headers.deadmansswitchExists only when
deadMansSwitch.enabledis true. Posts the alert to the URL read from/etc/alertmanager/secrets/<deadMansSwitch.urlSecret.name>/<deadMansSwitch.urlSecret.key>. Sends no resolved notifications.
SMTP settings#
The Alertmanager global block takes its values from the smtp configuration.
Alertmanager setting |
Source |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Inhibition rules#
Source |
Target |
Equal labels |
|---|---|---|
|
|
|
|
|
|
Notification links#
Alertmanager links to its own externalUrl, and each alert links to the externalUrl of Prometheus.
Both come from externalUrls; see Configuration options.
See also#
Alerting defaults — why the defaults look this way.
Configure SMTP alerting — how to set up mail delivery.
Tune alert notifications — how to change links and pacing.
Route staging alerts away from production — how to demote staging alerts.