Commit d85aa3b6 authored by Andrew Newdigate's avatar Andrew Newdigate

Remove the postgres:up recording which doesn't seem to monitor anything

useful.

This MR also removes the concept of `info` criticality alerts which don't
make much sense.

The `postgres:up` recording relied on `info` alerts but was the only thing
to do so.
parent 6483e63a
......@@ -285,7 +285,7 @@ groups:
- alert: PostgreSQL_RoleChange
expr: pg_replication_is_replica and changes(pg_replication_is_replica[1m]) > 0
labels:
severity: info
severity: warn
channel: database
annotations:
description: Database on {{$labels.fqdn}} changed role to {{if eq $value 1.0}}
......@@ -295,7 +295,7 @@ groups:
expr: '{__name__=~"pg_settings_.*"} != ON(__name__, fqdn) {__name__=~"pg_settings_([^t]|t[^r]|tr[^a]|tra[^n]|tran[^s]|trans[^a]|transa[^c]|transac[^t]|transact[^i]|transacti[^o]|transactio[^n]|transaction[^_]|transaction_[^r]|transaction_r[^e]|transaction_re[^a]|transaction_rea[^d]|transaction_read[^_]|transaction_read_[^o]|transaction_read_o[^n]|transaction_read_on[^l]|transaction_read_onl[^y]).*"}
OFFSET 10m'
labels:
severity: info
severity: warn
channel: database
annotations:
description: Database on {{$labels.fqdn}} setting now {{$labels.__name__}}={{$value}}
......
......@@ -23,12 +23,5 @@ groups:
== 1)
- record: postgres:databases
expr: count(pg_exporter_scrapes_total) BY (environment)
- record: postgres:up
expr: (count(pg_replication_is_replica == 1 unless ON(fqdn) ALERTS{alertname=~"PostgreSQL_.*",alertstate="firing",severity!="info"})
BY (environment) >= 2 and ON(environment) count(pg_replication_is_replica ==
0 unless ON(fqdn) ALERTS{alertname=~"PostgreSQL_.*",alertstate="firing",severity!="info"})
BY (environment) == 1 unless ON(environment) count(ALERTS{alertname=~"PostgreSQL_.*",alertstate="firing",fqdn="",severity!="info"})
BY (environment) > 0) > BOOL 0 or ON(environment) postgres:databases == BOOL
0
- record: postgres:pg_stat_seq_scans:rate2m
expr: rate(pg_stat_user_tables_seq_tup_read[2m])
......@@ -20,7 +20,7 @@ def validate_rule(alert_file_path, rule)
LOGGER.warn "#{alert_file_path}: #{alert}: Rules should contain a `description` annotation" unless annotations["description"]
raise StandardError, " #{alert}: rules must contain a `severity` label" unless labels["severity"]
raise StandardError, " #{alert}: rules contains an invalid `severity` label: #{labels["severity"]}" unless ["info", "warn", "error", "critical"].include?(labels["severity"])
raise StandardError, " #{alert}: rules contains an invalid `severity` label: #{labels["severity"]}" unless ["warn", "error", "critical"].include?(labels["severity"])
if labels["pager"]
raise StandardError, " #{alert}: rules contains an invalid `pager` label: #{labels["pager"]}" unless labels["pager"] == "pagerduty"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment