-
Notifications
You must be signed in to change notification settings - Fork 6
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
add warnings for throttling exceptions #1555
Changes from all commits
e1761af
491baa1
e0c40b7
03ea79e
ea056bb
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 |
---|---|---|
|
@@ -972,7 +972,7 @@ resource "aws_cloudwatch_metric_alarm" "service-callback-too-many-failures-warni | |
|
||
resource "aws_cloudwatch_metric_alarm" "service-callback-too-many-failures-critical" { | ||
count = var.cloudwatch_enabled ? 1 : 0 | ||
alarm_name = "service-callback-too-many-failures-warning" | ||
alarm_name = "service-callback-too-many-failures-critical" | ||
alarm_description = "Service reached the max number of callback retries 100 times in 10 minutes" | ||
comparison_operator = "GreaterThanOrEqualToThreshold" | ||
evaluation_periods = "1" | ||
|
@@ -984,3 +984,33 @@ resource "aws_cloudwatch_metric_alarm" "service-callback-too-many-failures-criti | |
treat_missing_data = "notBreaching" | ||
alarm_actions = [var.sns_alert_critical_arn] | ||
} | ||
|
||
resource "aws_cloudwatch_metric_alarm" "throttling-exception-warning" { | ||
count = var.cloudwatch_enabled ? 1 : 0 | ||
alarm_name = "throttling-exception-warning" | ||
alarm_description = "Have received a throttling exception in the last minute" | ||
comparison_operator = "GreaterThanOrEqualToThreshold" | ||
evaluation_periods = "1" | ||
metric_name = aws_cloudwatch_log_metric_filter.throttling-exceptions[0].metric_transformation[0].name | ||
namespace = aws_cloudwatch_log_metric_filter.throttling-exceptions[0].metric_transformation[0].namespace | ||
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. The |
||
period = 60 | ||
statistic = "Sum" | ||
threshold = 1 | ||
treat_missing_data = "notBreaching" | ||
alarm_actions = [var.sns_alert_warning_arn] | ||
} | ||
|
||
resource "aws_cloudwatch_metric_alarm" "many-throttling-exceptions-warning" { | ||
count = var.cloudwatch_enabled ? 1 : 0 | ||
alarm_name = "many-throttling-exceptions-warning" | ||
alarm_description = "Have received 100 throttling exception in the last minute" | ||
comparison_operator = "GreaterThanOrEqualToThreshold" | ||
evaluation_periods = "1" | ||
metric_name = aws_cloudwatch_log_metric_filter.throttling-exceptions[0].metric_transformation[0].name | ||
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. The |
||
namespace = aws_cloudwatch_log_metric_filter.throttling-exceptions[0].metric_transformation[0].namespace | ||
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. The |
||
period = 60 | ||
statistic = "Sum" | ||
threshold = 100 | ||
treat_missing_data = "notBreaching" | ||
alarm_actions = [var.sns_alert_warning_arn] | ||
} |
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.
The
metric_name
should be a string value, but it seems to be referencing an array element. Ensure thataws_cloudwatch_log_metric_filter.throttling-exceptions[0].metric_transformation[0].name
is correctly defined and accessible.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.
True that we'd have a problem if those
[0]
array elements didn't exist, but that doesn't have anything to do with the type ofmetric_name
, and it's the pattern we use everywhere. (and we only declare all these things ifcloudwatch_enabled
is set so they all work together).