UPD: added read write latency checks for RDS

This commit is contained in:
KF 2022-10-25 15:57:57 +08:00
parent 4438ecbcd5
commit f9b80bd6d2
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
2 changed files with 49 additions and 1 deletions

View File

@ -89,3 +89,49 @@ resource aws_cloudwatch_metric_alarm rds-DiskQueueDepth {
ignore_changes = [tags]
}
}
resource aws_cloudwatch_metric_alarm rds-ReadLetency {
alarm_name = "RDS:ReadLetency:${var.rds-instance-name}"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "2"
metric_name = "ReadLetency"
period = "600"
statistic = "Average"
threshold = var.threshold-ReadLetency
alarm_description = "RDS:ReadLetency"
namespace = "AWS/RDS"
insufficient_data_actions = []
actions_enabled = "true"
alarm_actions = [var.alarm-actions-urgent]
ok_actions = [var.alarm-actions-urgent]
dimensions = {
DBInstanceIdentifier = var.rds-instance-name
}
tags = var.default-tags
lifecycle {
ignore_changes = [tags]
}
}
resource aws_cloudwatch_metric_alarm rds-WriteLetency {
alarm_name = "RDS:WriteLetency:${var.rds-instance-name}"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "2"
metric_name = "WriteLetency"
period = "600"
statistic = "Average"
threshold = var.threshold-WriteLetency
alarm_description = "RDS:WriteLetency"
namespace = "AWS/RDS"
insufficient_data_actions = []
actions_enabled = "true"
alarm_actions = [var.alarm-actions-urgent]
ok_actions = [var.alarm-actions-urgent]
dimensions = {
DBInstanceIdentifier = var.rds-instance-name
}
tags = var.default-tags
lifecycle {
ignore_changes = [tags]
}
}

View File

@ -21,3 +21,5 @@ variable threshold-FreeableMemory {}
variable threshold-CpuUtilization {}
variable threshold-FreeStorageSpace {}
variable threshold-DiskQueueDepth {}
variable threshold-ReadLetency {}
variable threshold-WriteLetency {}