Skip to content

Commit

Permalink
Merge pull request #71 from DFE-Digital/662-register-production-monit…
Browse files Browse the repository at this point in the history
…oring-issue

Set alert expr to use equal instead of regex equal
  • Loading branch information
RMcVelia authored Aug 23, 2022
2 parents 038a1d4 + 0abad6a commit 5856156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus/templates/pg_alert.rules.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ groups:
rules:
%{ for instance in alertable_postgres_instances ~}
- alert: Postgres memory available low (instance - ${instance.pg_instance}, space - ${instance.pg_spacename})
expr: min_over_time(freeable_memory_bytes{service=~"${instance.pg_instance}",space="${instance.pg_spacename}"}[15m])/1024/1024/1024 < ${instance.min_mem}
expr: min_over_time(freeable_memory_bytes{service="${instance.pg_instance}",space="${instance.pg_spacename}"}[15m])/1024/1024/1024 < ${instance.min_mem}
for: 5m
annotations:
summary: ${instance.pg_instance} low memory available
Expand All @@ -19,7 +19,7 @@ groups:
rules:
%{ for instance in alertable_postgres_instances ~}
- alert: Postgres CPU Utilisation high (instance - ${instance.pg_instance}, space - ${instance.pg_spacename})
expr: max_over_time(cpu_percent{service=~"${instance.pg_instance}",space="${instance.pg_spacename}"}[15m]) > ${instance.max_cpu}
expr: max_over_time(cpu_percent{service="${instance.pg_instance}",space="${instance.pg_spacename}"}[15m]) > ${instance.max_cpu}
for: 5m
annotations:
summary: ${instance.pg_instance} high CPU Utilisation
Expand All @@ -35,7 +35,7 @@ groups:
rules:
%{ for instance in alertable_postgres_instances ~}
- alert: Postgres Storage available low (instance - ${instance.pg_instance}, space - ${instance.pg_spacename})
expr: min_over_time(free_storage_space_bytes{service=~"${instance.pg_instance}",space="${instance.pg_spacename}"}[15m])/1024/1024/1024 < ${instance.min_stg}
expr: min_over_time(free_storage_space_bytes{service="${instance.pg_instance}",space="${instance.pg_spacename}"}[15m])/1024/1024/1024 < ${instance.min_stg}
for: 5m
annotations:
summary: ${instance.pg_instance} low storage available
Expand Down

0 comments on commit 5856156

Please sign in to comment.