Skip to content

Commit

Permalink
UML-3396: Create metric alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-whitwell committed Aug 8, 2024
1 parent 7af21a3 commit d2e1830
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions terraform/environment/alerts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,25 @@ resource "aws_cloudwatch_metric_alarm" "rest_api_high_count" {
threshold = 500
treat_missing_data = "notBreaching"
}

resource "aws_cloudwatch_metric_alarm" "rest_api_slow_response" {
actions_enabled = true
alarm_actions = [data.aws_sns_topic.rest_api.arn]
alarm_description = "Average response time over a minute for LPA Data Rest API in ${terraform.workspace}"
alarm_name = "lpa-${local.environment}-rest-api-slow-response"
comparison_operator = "GreaterThanThreshold"
datapoints_to_alarm = 2
dimensions = {
ApiName = "lpa-${terraform.workspace}"
}
evaluation_periods = 2
insufficient_data_actions = []
metric_name = "Latency"
namespace = "AWS/ApiGateway"
ok_actions = [data.aws_sns_topic.rest_api.arn]
period = 60
statistic = "Average"
tags = {}
threshold = 3500
treat_missing_data = "notBreaching"
}

0 comments on commit d2e1830

Please sign in to comment.