X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/1ac238e5f43bfd0f77675d9e7e6e326e9916c3d8..b8d8c5b86947c933602e98057c106a2f97c040f7:/cookbooks/prometheus/templates/default/alert_rules.yml.erb diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index 598179d5c..f64b7fc08 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -112,6 +112,20 @@ groups: alertgroup: database annotations: delay: "{{ $value | humanizeDuration }}" + - alert: active rails queries + expr: sum(pg_stat_activity_count{instance="snap-01",datname="openstreetmap",usename="rails",state="active"}) > 50 and on (instance) chef_role{name="db-master"} + for: 5m + labels: + alertgroup: database + annotations: + queries: "{{ $value }}" + - alert: active cgimap queries + expr: sum(pg_stat_activity_count{instance="snap-01",datname="openstreetmap",usename="cgimap",state="active"}) > 30 and on (instance) chef_role{name="db-master"} + for: 5m + labels: + alertgroup: database + annotations: + delay: "{{ $value }}" - name: discourse rules: - alert: discourse job failure rate