-
Notifications
You must be signed in to change notification settings - Fork 5
Tweaked sns-sms-success-rate-canadian-numbers-us-west-2-critical #1854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3e6bbb0
b40f873
92cbf09
b908e82
0f8fefb
6a37306
7da7343
9181697
4e00735
4b5710a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,7 +140,7 @@ resource "aws_cloudwatch_metric_alarm" "sns-sms-success-rate-canadian-numbers-us | |
| id = "alarmCondition" | ||
| label = "Guarded Alarm Condition" | ||
| return_data = true | ||
| expression = "IF(successRate < 0.85 AND messagesPublished > 75, 0, 1)" | ||
| expression = "IF(successRate < 0.85 AND messagesPublished > 85, 0, 1)" | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -167,24 +167,55 @@ resource "aws_cloudwatch_metric_alarm" "sns-sms-success-rate-canadian-numbers-cr | |
|
|
||
| resource "aws_cloudwatch_metric_alarm" "sns-sms-success-rate-canadian-numbers-us-west-2-critical" { | ||
| provider = aws.us-west-2 | ||
| count = var.cloudwatch_enabled ? 1 : 0 | ||
|
|
||
| count = var.cloudwatch_enabled ? 1 : 0 | ||
| alarm_name = "sns-sms-success-rate-canadian-numbers-us-west-2-critical" | ||
| alarm_description = "SMS success rate to Canadian numbers is below 75% over 2 consecutive periods of 12 hours" | ||
| comparison_operator = "LessThanThreshold" | ||
| evaluation_periods = "2" | ||
| datapoints_to_alarm = "2" | ||
| metric_name = "SMSSuccessRate" | ||
| namespace = "AWS/SNS" | ||
| period = 60 * 60 * 12 | ||
| statistic = "Average" | ||
| threshold = 75 / 100 | ||
| threshold = 1 | ||
| alarm_actions = [aws_sns_topic.notification-canada-ca-alert-critical-us-west-2.arn] | ||
| ok_actions = [aws_sns_topic.notification-canada-ca-alert-ok-us-west-2.arn] | ||
| treat_missing_data = "notBreaching" | ||
| dimensions = { | ||
| SMSType = "Transactional" | ||
| Country = "CA" | ||
|
|
||
| metric_query { | ||
| id = "successRate" | ||
| label = "Success Rate" | ||
| return_data = false | ||
| metric { | ||
| namespace = "AWS/SNS" | ||
| metric_name = "SMSSuccessRate" | ||
| period = 60 * 60 * 12 | ||
| stat = "Average" | ||
| dimensions = { | ||
| SMSType = "Transactional" | ||
| Country = "CA" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| metric_query { | ||
| id = "messagesPublished" | ||
| label = "Messages Published" | ||
| return_data = false | ||
| metric { | ||
| namespace = "AWS/SNS" | ||
| metric_name = "NumberOfMessagesPublished" | ||
| period = 60 * 60 * 12 | ||
| stat = "Sum" | ||
| dimensions = { | ||
| SMSType = "Transactional" | ||
| Country = "CA" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| metric_query { | ||
| id = "alarmCondition" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it not matter that there are two metric_query's with the same id?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the |
||
| label = "Guarded Alarm Condition" | ||
| return_data = true | ||
| expression = "IF(successRate < 0.75 AND messagesPublished > 75, 0, 1)" | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a typo on my part