Skip to content

Commit

Permalink
CRIMAPP-1448 Prometheus rules for RDS in Crime Apply staging
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinKruglov committed Nov 1, 2024
1 parent 49c867d commit 0c8e152
Showing 1 changed file with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Prometheus Alerts
#
# https://user-guide.cloud-platform.service.justice.gov.uk/documentation/monitoring-an-app/how-to-create-alarms.html
#
# Note: we are using a regex in the namespace to filter and trigger alerts
# in both, staging and production environments.
#
# To see the current alerts in this namespace:
# kubectl describe prometheusrule -n laa-apply-for-criminal-legal-aid-staging
#
# Alerts will be sent to the slack channel: #laa-crime-apply-alerts
#
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: prometheus-rules-rds
namespace: laa-apply-for-criminal-legal-aid-staging
labels:
role: alert-rules
prometheus: cloud-platform
spec:
groups:
- name: rds-rules
rules:
- alert: CrimeApply-Staging-RDS-HighCPUUtilization
expr: aws_rds_cpuutilization_average{dbinstance_identifier="cloud-platform-f3b7a38b29b21644"} > 25
for: 1m
labels:
severity: laa-crime-apply-alerts
annotations:
message: Crime Apply staging - RDS CPU usage > 25%.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/VR46pmwWk/aws-rds?orgId=1&var-datasource=P896B4444D3F0DAB8&var-region=default&var-dbinstanceidentifier=cloud-platform-f3b7a38b29b21644

- alert: CrimeApply-Staging-RDS-LowStorage
expr: aws_rds_free_storage_space_average{dbinstance_identifier="cloud-platform-f3b7a38b29b21644"} < 1024*1024*1024
for: 1m
labels:
severity: laa-crime-apply-alerts
annotations:
message: Crime Apply staging - RDS storage capacity < 1GB.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/VR46pmwWk/aws-rds?orgId=1&var-datasource=P896B4444D3F0DAB8&var-region=default&var-dbinstanceidentifier=cloud-platform-f3b7a38b29b21644

- alert: CrimeApply-Staging-RDS-HighReadLatency
expr: aws_rds_read_latency_average{dbinstance_identifier="cloud-platform-f3b7a38b29b21644"} > 0.5
for: 1m
labels:
severity: laa-crime-apply-alerts
annotations:
message: Crime Apply staging - RDS read latency > 500ms.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/VR46pmwWk/aws-rds?orgId=1&var-datasource=P896B4444D3F0DAB8&var-region=default&var-dbinstanceidentifier=cloud-platform-f3b7a38b29b21644

- alert: CrimeApply-Staging-RDS-HighWriteLatency
expr: aws_rds_write_latency_average{dbinstance_identifier="cloud-platform-f3b7a38b29b21644"} > 0.5
for: 1m
labels:
severity: laa-crime-apply-alerts
annotations:
message: Crime Apply staging - RDS write latency > 500ms.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/VR46pmwWk/aws-rds?orgId=1&var-datasource=P896B4444D3F0DAB8&var-region=default&var-dbinstanceidentifier=cloud-platform-f3b7a38b29b21644

- alert: CrimeApply-Staging-RDS-HighDatabaseConnections
expr: aws_rds_database_connections_average{dbinstance_identifier="cloud-platform-f3b7a38b29b21644"} > 20
for: 1m
labels:
severity: laa-crime-apply-alerts
annotations:
message: Crime Apply staging - RDS number of database connections > 20.
dashboard_url: https://grafana.live.cloud-platform.service.justice.gov.uk/d/VR46pmwWk/aws-rds?orgId=1&var-datasource=P896B4444D3F0DAB8&var-region=default&var-dbinstanceidentifier=cloud-platform-f3b7a38b29b21644

0 comments on commit 0c8e152

Please sign in to comment.