Skip to content

Commit 7d359e9

Browse files
committed
Update RDS CloudWatch alarm parameters for more robust monitoring
1 parent 854a65e commit 7d359e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

infra/terraform/hash/postgres/alerts.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ resource "aws_cloudwatch_metric_alarm" "rds_free_storage_space" {
2929
namespace = "AWS/RDS"
3030
statistic = "Minimum"
3131
period = 300 # 5 minutes
32-
evaluation_periods = 2 # Must be low for 10 minutes total
32+
evaluation_periods = 2 # 10 minutes total
33+
datapoints_to_alarm = 2 # Both datapoints must be low
3334
threshold = 10 * 1024 * 1024 * 1024 # 10GB in bytes
3435
comparison_operator = "LessThanThreshold"
3536
treat_missing_data = "breaching"
@@ -58,7 +59,8 @@ resource "aws_cloudwatch_metric_alarm" "rds_cpu_utilization_high" {
5859
namespace = "AWS/RDS"
5960
statistic = "Average"
6061
period = 300 # 5 minutes
61-
evaluation_periods = 2 # Must be high for 10 minutes total
62+
evaluation_periods = 5 # 25 minutes total
63+
datapoints_to_alarm = 3 # 3 of 5 datapoints must be high (grace for spikes)
6264
threshold = 80 # 80%
6365
comparison_operator = "GreaterThanThreshold"
6466
treat_missing_data = "notBreaching"
@@ -87,7 +89,8 @@ resource "aws_cloudwatch_metric_alarm" "rds_freeable_memory_low" {
8789
namespace = "AWS/RDS"
8890
statistic = "Minimum"
8991
period = 300 # 5 minutes
90-
evaluation_periods = 2 # Must be low for 10 minutes total
92+
evaluation_periods = 3 # 15 minutes total
93+
datapoints_to_alarm = 2 # 2 of 3 datapoints must be low (moderate grace)
9194
threshold = 256 * 1024 * 1024 # 256MB in bytes
9295
comparison_operator = "LessThanThreshold"
9396
treat_missing_data = "breaching"

0 commit comments

Comments
 (0)