Skip to content

Commit

Permalink
Merge pull request #158 from ministryofjustice/UML-3396
Browse files Browse the repository at this point in the history
UML-3396: Create metric alarm
  • Loading branch information
jay-whitwell authored Aug 8, 2024
2 parents 7af21a3 + d2e1830 commit 0f2b8b9
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 0f2b8b9

Please sign in to comment.