Created
June 4, 2019 09:22
-
-
Save simontabor/7581459b218caefc11d83870aac8a226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_metric_alarm" "alb_error_rate" { | |
alarm_name = "${aws_lb.main.name}-alb-error-rate" | |
comparison_operator = "GreaterThanOrEqualToThreshold" | |
evaluation_periods = 2 | |
threshold = 5 | |
alarm_description = "Load balancer error rate has exceeded 5%" | |
treat_missing_data = "notBreaching" | |
metric_query { | |
id = "error_rate" | |
expression = "5xx_count / request_count *100" | |
label = "Error Rate" | |
return_data = true | |
} | |
# metric queries for 5xx_count and request_count... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment