Skip to content

Commit

Permalink
fix: use maximum CPU/memory stat for alarms (#820)
Browse files Browse the repository at this point in the history
Update the App, API and IdP ECS CPU and memory alarms to use the 
Maximum statistic rather than Average.

This will make the alarms more responsive to individual ECS tasks
that are overloaded.
  • Loading branch information
patheard authored Sep 10, 2024
1 parent 27de887 commit 9e53e16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions aws/alarms/cloudwatch_api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_cloudwatch_metric_alarm" "api_cpu_utilization_high_warn" {
metric_name = "CPUUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_cpu_utilization_high
treat_missing_data = "notBreaching"

Expand All @@ -34,7 +34,7 @@ resource "aws_cloudwatch_metric_alarm" "api_memory_utilization_high_warn" {
metric_name = "MemoryUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_memory_utilization_high
treat_missing_data = "notBreaching"

Expand Down
4 changes: 2 additions & 2 deletions aws/alarms/cloudwatch_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_cloudwatch_metric_alarm" "forms_cpu_utilization_high_warn" {
metric_name = "CPUUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_cpu_utilization_high
alarm_description = "End User Forms Warning - High CPU usage has been detected."

Expand All @@ -27,7 +27,7 @@ resource "aws_cloudwatch_metric_alarm" "forms_memory_utilization_high_warn" {
metric_name = "MemoryUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_memory_utilization_high
alarm_description = "End User Forms Warning - High memory usage has been detected."

Expand Down
4 changes: 2 additions & 2 deletions aws/alarms/cloudwatch_idp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_cloudwatch_metric_alarm" "idp_cpu_utilization_high_warn" {
metric_name = "CPUUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_cpu_utilization_high
treat_missing_data = "notBreaching"

Expand All @@ -34,7 +34,7 @@ resource "aws_cloudwatch_metric_alarm" "idp_memory_utilization_high_warn" {
metric_name = "MemoryUtilization"
namespace = "AWS/ECS"
period = "120"
statistic = "Average"
statistic = "Maximum"
threshold = var.threshold_ecs_memory_utilization_high
treat_missing_data = "notBreaching"

Expand Down

0 comments on commit 9e53e16

Please sign in to comment.