-
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 warning and critical alarms for callbacks #1352
Conversation
- Initial alarms for callbacks that consistently fail for a service
- Moved alarms from aws/eks/ to aws/common - Instead of looking for any callback failure we now look for callbacks that hit the max retries - looking for 5 breaches in 30 minutes across a single evaluation period - Added a cloudwatch query to count the number of times a service hit the max retries for callbacks
Updating alarms ⏰? Great! Please update the Google Sheet and add a 👍 to this message after 🙏 |
Updating alarms ⏰? Great! Please update the Google Sheet and add a 👍 to this message after 🙏 |
2 similar comments
Updating alarms ⏰? Great! Please update the Google Sheet and add a 👍 to this message after 🙏 |
Updating alarms ⏰? Great! Please update the Google Sheet and add a 👍 to this message after 🙏 |
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.
Nice! Please make sure to update the spreadsheet :)
Staging: eks✅ Terraform Init: Plan: 3 to add, 0 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_cloudwatch_log_metric_filter.callback-max-retry-failures[0] will be created
+ resource "aws_cloudwatch_log_metric_filter" "callback-max-retry-failures" {
+ id = (known after apply)
+ log_group_name = "/aws/containerinsights/notification-canada-ca-staging-eks-cluster/application"
+ name = "callback-max-retry-failures"
+ pattern = "Retry: send_delivery_status_to_service has retried the max num of times for callback url"
+ metric_transformation {
+ dimensions = {
+ "notification_id" = "$.notification_id"
+ "service_id" = "$.service"
+ "url" = "$.url"
}
+ name = "callback-max-retry-failures"
+ namespace = "LogMetrics"
+ unit = "None"
+ value = "1"
}
}
# aws_cloudwatch_metric_alarm.service-callback-too-many-failures-warning[0] will be created
+ resource "aws_cloudwatch_metric_alarm" "service-callback-too-many-failures-warning" {
+ actions_enabled = true
+ alarm_actions = [
+ "arn:aws:sns:ca-central-1:239043911459:alert-warning",
]
+ alarm_description = "Service reached the max number of callback retries 5 times in 30 minutes"
+ alarm_name = "service-callback-too-many-failures-warning"
+ arn = (known after apply)
+ comparison_operator = "GreaterThanOrEqualToThreshold"
+ evaluate_low_sample_count_percentiles = (known after apply)
+ evaluation_periods = 1
+ id = (known after apply)
+ metric_name = "callback-max-retry-failures"
+ namespace = "LogMetrics"
+ period = 1800
+ statistic = "Sum"
+ tags_all = (known after apply)
+ threshold = 5
+ treat_missing_data = "notBreaching"
}
# aws_cloudwatch_query_definition.callback-failures-by-service[0] will be created
+ resource "aws_cloudwatch_query_definition" "callback-failures-by-service" {
+ id = (known after apply)
+ log_group_names = [
+ "/aws/containerinsights/notification-canada-ca-staging-eks-cluster/application",
]
+ name = "Count of callbacks that exceeded MaxRetries by service"
+ query_definition_id = (known after apply)
+ query_string = <<-EOT
fields @timestamp, @service_id, @callback_url, @notification_id
| filter kubernetes.container_name like /^celery/
| filter @message like /send_delivery_status_to_service has retried the max num of times for callback url/
| parse @message 'Retry: send_delivery_status_to_service has retried the max num of times for callback url * and notification_id: * for service: *' as @callback_url, @notification_id, @service_id
| sort @timestamp desc
| stats count(@service_id) by @service_id, bin(30m)
| limit 10000
EOT
}
Plan: 3 to add, 0 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest resultsWARN - plan.json - main - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.callback-max-retry-failures[0]"]
WARN - plan.json - main - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.celery-error[0]"]
WARN - plan.json - main - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.scanfiles-timeout[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.client_vpn"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca-alt[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener.internal_alb_tls"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.internal_nginx_http"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-admin"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-documentation"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-application-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-cluster-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-prometheus-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-evicted-pods[0]"]
WARN... |
Summary | Résumé
This PR adds new alarms to warn when delivery of callbacks have reached the max retry of 5, at least 5 times over a 30 minute period.
Related Issues | Cartes liées
Test instructions | Instructions pour tester la modification
TODO: Fill in test instructions for the reviewer.
Release Instructions | Instructions pour le déploiement
None.
Reviewer checklist | Liste de vérification du réviseur