2018-05-09 10:02:33 -07:00
{
prometheusAlerts+:: {
groups+: [
{
name: 'prometheus',
rules: [
{
2018-11-19 03:22:55 -08:00
alert: 'PrometheusBadConfig',
2018-05-09 10:02:33 -07:00
expr: |||
2019-06-28 07:46:19 -07:00
# Without max_over_time, failed scrapes could create false negatives, see
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details.
max_over_time(prometheus_config_last_reload_successful{%(prometheusSelector)s}[5m]) == 0
2018-05-09 10:02:33 -07:00
||| % $._config,
2019-06-28 07:46:19 -07:00
'for': '10m',
2018-05-09 10:02:33 -07:00
labels: {
severity: 'critical',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Failed Prometheus configuration reload.',
description: 'Prometheus %(prometheusName)s has failed to reload its configuration.' % $._config,
2018-05-09 10:02:33 -07:00
},
},
{
2018-11-19 03:22:55 -08:00
alert: 'PrometheusNotificationQueueRunningFull',
2018-05-09 10:02:33 -07:00
expr: |||
2019-06-28 07:46:19 -07:00
# Without min_over_time, failed scrapes could create false negatives, see
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details.
2019-06-26 11:31:05 -07:00
(
predict_linear(prometheus_notifications_queue_length{%(prometheusSelector)s}[5m], 60 * 30)
2018-11-19 03:22:55 -08:00
>
2019-06-28 07:46:19 -07:00
min_over_time(prometheus_notifications_queue_capacity{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
)
2018-05-09 10:02:33 -07:00
||| % $._config,
2018-11-19 03:22:55 -08:00
'for': '15m',
2018-05-09 10:02:33 -07:00
labels: {
2018-11-19 03:22:55 -08:00
severity: 'warning',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus alert notification queue predicted to run full in less than 30m.',
description: 'Alert notification queue of Prometheus %(prometheusName)s is running full.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
2019-06-27 14:50:26 -07:00
alert: 'PrometheusErrorSendingAlertsToSomeAlertmanagers',
2018-11-19 03:22:55 -08:00
expr: |||
2019-06-26 11:31:05 -07:00
(
rate(prometheus_notifications_errors_total{%(prometheusSelector)s}[5m])
2018-11-19 03:22:55 -08:00
/
2019-06-27 14:50:26 -07:00
rate(prometheus_notifications_sent_total{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
)
* 100
2019-06-27 14:50:26 -07:00
> 1
2018-11-19 03:22:55 -08:00
||| % $._config,
'for': '15m',
labels: {
severity: 'warning',
2018-05-09 10:02:33 -07:00
},
annotations: {
2019-06-28 08:37:49 -07:00
summary: 'Prometheus has encountered more than 1% errors sending alerts to a specific Alertmanager.',
2019-06-27 14:50:26 -07:00
description: '{{ printf "%%.1f" $value }}%% errors while sending alerts from Prometheus %(prometheusName)s to Alertmanager {{$labels.alertmanager}}.' % $._config,
2018-05-09 10:02:33 -07:00
},
},
{
2019-06-27 14:50:26 -07:00
alert: 'PrometheusErrorSendingAlertsToAnyAlertmanager',
2018-05-09 10:02:33 -07:00
expr: |||
2019-06-27 14:50:26 -07:00
min without(alertmanager) (
2019-06-26 11:31:05 -07:00
rate(prometheus_notifications_errors_total{%(prometheusSelector)s}[5m])
2018-11-19 03:22:55 -08:00
/
2019-06-26 11:31:05 -07:00
rate(prometheus_notifications_sent_total{%(prometheusSelector)s}[5m])
)
* 100
> 3
2018-05-09 10:02:33 -07:00
||| % $._config,
2018-11-19 03:22:55 -08:00
'for': '15m',
2018-05-09 10:02:33 -07:00
labels: {
severity: 'critical',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus encounters more than 3% errors sending alerts to any Alertmanager.',
description: '{{ printf "%%.1f" $value }}%% minimum errors while sending alerts from Prometheus %(prometheusName)s to any Alertmanager.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
alert: 'PrometheusNotConnectedToAlertmanagers',
expr: |||
2019-06-28 07:46:19 -07:00
# Without max_over_time, failed scrapes could create false negatives, see
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details.
max_over_time(prometheus_notifications_alertmanagers_discovered{%(prometheusSelector)s}[5m]) < 1
2018-11-19 03:22:55 -08:00
||| % $._config,
'for': '10m',
labels: {
severity: 'warning',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus is not connected to any Alertmanagers.',
description: 'Prometheus %(prometheusName)s is not connected to any Alertmanagers.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
alert: 'PrometheusTSDBReloadsFailing',
expr: |||
2019-06-26 14:22:16 -07:00
increase(prometheus_tsdb_reloads_failures_total{%(prometheusSelector)s}[3h]) > 0
2018-11-19 03:22:55 -08:00
||| % $._config,
2019-06-26 14:22:16 -07:00
'for': '4h',
2018-11-19 03:22:55 -08:00
labels: {
severity: 'warning',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus has issues reloading blocks from disk.',
description: 'Prometheus %(prometheusName)s has detected {{$value | humanize}} reload failures over the last 3h.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
alert: 'PrometheusTSDBCompactionsFailing',
expr: |||
2019-06-26 14:22:16 -07:00
increase(prometheus_tsdb_compactions_failed_total{%(prometheusSelector)s}[3h]) > 0
2018-11-19 03:22:55 -08:00
||| % $._config,
2019-06-26 14:22:16 -07:00
'for': '4h',
2018-11-19 03:22:55 -08:00
labels: {
severity: 'warning',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus has issues compacting blocks.',
description: 'Prometheus %(prometheusName)s has detected {{$value | humanize}} compaction failures over the last 3h.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
alert: 'PrometheusNotIngestingSamples',
expr: |||
rate(prometheus_tsdb_head_samples_appended_total{%(prometheusSelector)s}[5m]) <= 0
||| % $._config,
'for': '10m',
labels: {
severity: 'warning',
},
2018-11-19 04:23:42 -08:00
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus is not ingesting samples.',
description: 'Prometheus %(prometheusName)s is not ingesting samples.' % $._config,
2018-11-19 03:22:55 -08:00
},
},
{
2019-06-27 14:50:26 -07:00
alert: 'PrometheusDuplicateTimestamps',
2018-11-19 03:22:55 -08:00
expr: |||
2019-06-27 14:50:26 -07:00
rate(prometheus_target_scrapes_sample_duplicate_timestamp_total{%(prometheusSelector)s}[5m]) > 0
2018-11-19 03:22:55 -08:00
||| % $._config,
'for': '10m',
labels: {
severity: 'warning',
},
annotations: {
2019-06-28 08:37:49 -07:00
summary: 'Prometheus is dropping samples with duplicate timestamps.',
2019-09-24 08:44:27 -07:00
description: 'Prometheus %(prometheusName)s is dropping {{ printf "%%.4g" $value }} samples/s with different values but duplicated timestamp.' % $._config,
2019-06-27 14:50:26 -07:00
},
},
{
alert: 'PrometheusOutOfOrderTimestamps',
expr: |||
rate(prometheus_target_scrapes_sample_out_of_order_total{%(prometheusSelector)s}[5m]) > 0
||| % $._config,
'for': '10m',
labels: {
severity: 'warning',
},
annotations: {
summary: 'Prometheus drops samples with out-of-order timestamps.',
2019-09-24 08:44:27 -07:00
description: 'Prometheus %(prometheusName)s is dropping {{ printf "%%.4g" $value }} samples/s with timestamps arriving out of order.' % $._config,
2018-05-09 10:02:33 -07:00
},
},
{
2018-11-19 03:22:55 -08:00
alert: 'PrometheusRemoteStorageFailures',
2018-05-09 10:02:33 -07:00
expr: |||
2019-06-26 11:31:05 -07:00
(
2019-06-26 14:22:16 -07:00
rate(prometheus_remote_storage_failed_samples_total{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
/
(
2019-06-26 14:22:16 -07:00
rate(prometheus_remote_storage_failed_samples_total{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
+
2019-06-26 14:22:16 -07:00
rate(prometheus_remote_storage_succeeded_samples_total{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
)
)
* 100
> 1
2018-05-09 10:02:33 -07:00
||| % $._config,
'for': '15m',
labels: {
severity: 'critical',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus fails to send samples to remote storage.',
description: 'Prometheus %(prometheusName)s failed to send {{ printf "%%.1f" $value }}%% of the samples to queue {{$labels.queue}}.' % $._config,
2018-05-09 10:02:33 -07:00
},
},
2019-02-12 07:22:58 -08:00
{
alert: 'PrometheusRemoteWriteBehind',
expr: |||
2019-06-28 07:46:19 -07:00
# Without max_over_time, failed scrapes could create false negatives, see
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details.
2019-06-26 11:31:05 -07:00
(
2019-06-28 07:46:19 -07:00
max_over_time(prometheus_remote_storage_highest_timestamp_in_seconds{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
- on(job, instance) group_right
2019-06-28 07:46:19 -07:00
max_over_time(prometheus_remote_storage_queue_highest_sent_timestamp_seconds{%(prometheusSelector)s}[5m])
2019-06-26 11:31:05 -07:00
)
> 120
2019-02-12 07:22:58 -08:00
||| % $._config,
'for': '15m',
labels: {
severity: 'critical',
},
annotations: {
2019-06-27 14:50:26 -07:00
summary: 'Prometheus remote write is behind.',
description: 'Prometheus %(prometheusName)s remote write is {{ printf "%%.1f" $value }}s behind for queue {{$labels.queue}}.' % $._config,
2019-02-12 07:22:58 -08:00
},
},
2019-08-02 17:39:32 -07:00
{
alert: 'PrometheusRemoteWriteDesiredShards',
expr: |||
# Without max_over_time, failed scrapes could create false negatives, see
# https://www.robustperception.io/alerting-on-gauges-in-prometheus-2-0 for details.
(
max_over_time(prometheus_remote_storage_shards_desired{%(prometheusSelector)s}[5m])
2019-10-28 13:36:10 -07:00
>
2019-08-02 17:39:32 -07:00
max_over_time(prometheus_remote_storage_shards_max{%(prometheusSelector)s}[5m])
)
||| % $._config,
'for': '15m',
labels: {
severity: 'warning',
},
annotations: {
summary: 'Prometheus remote write desired shards calculation wants to run more than configured max shards.',
2019-10-30 05:24:22 -07:00
description: 'Prometheus %(prometheusName)s remote write desired shards calculation wants to run {{ $value }} shards, which is more than the max of {{ printf `prometheus_remote_storage_shards_max{instance="%%s",%(prometheusSelector)s}` $labels.instance | query | first | value }}.' % $._config,
2019-08-02 17:39:32 -07:00
},
},
2018-05-09 10:02:33 -07:00
{
2018-11-19 03:22:55 -08:00
alert: 'PrometheusRuleFailures',
2018-05-09 10:02:33 -07:00
expr: |||
2019-06-27 14:50:26 -07:00
increase(prometheus_rule_evaluation_failures_total{%(prometheusSelector)s}[5m]) > 0
2018-05-09 10:02:33 -07:00
||| % $._config,
2019-06-26 14:22:16 -07:00
'for': '15m',
2018-05-09 10:02:33 -07:00
labels: {
severity: 'critical',
},
annotations: {
2019-06-28 08:37:49 -07:00
summary: 'Prometheus is failing rule evaluations.',
2019-06-27 14:50:26 -07:00
description: 'Prometheus %(prometheusName)s has failed to evaluate {{ printf "%%.0f" $value }} rules in the last 5m.' % $._config,
},
},
{
alert: 'PrometheusMissingRuleEvaluations',
expr: |||
increase(prometheus_rule_group_iterations_missed_total{%(prometheusSelector)s}[5m]) > 0
||| % $._config,
'for': '15m',
labels: {
severity: 'warning',
},
annotations: {
2019-06-28 08:37:49 -07:00
summary: 'Prometheus is missing rule evaluations due to slow rule group evaluation.',
2019-06-27 14:50:26 -07:00
description: 'Prometheus %(prometheusName)s has missed {{ printf "%%.0f" $value }} rule group evaluations in the last 5m.' % $._config,
2018-05-09 10:02:33 -07:00
},
},
],
},
],
},
}