-
Notifications
You must be signed in to change notification settings - Fork 0
Add alerts for bounce notifications jobs #2119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
infra/deployments/forms/health/alerts/failed-bounce-notifications-job-executions.tf
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| resource "aws_cloudwatch_metric_alarm" "failed_bounce_notifications_job_executions" { | ||
| alarm_name = "${var.environment}-failed-bounce-notifications-job-executions" | ||
| alarm_description = <<EOF | ||
| There are one or more failed job executions for the bounce_notifications queue in forms-runner in the ${var.environment} | ||
| environment that will not automatically be retried. | ||
|
|
||
| Follow the runbook to respond to this: https://github.com/govuk-forms/forms-team/wiki/Runbooks#handle-failed-solid-queue-jobs | ||
|
|
||
| Only close this Zendesk ticket when we get another Zendesk ticket to tell us that the alarm is in the OK state. | ||
| EOF | ||
| comparison_operator = "GreaterThanOrEqualToThreshold" | ||
| evaluation_periods = 1 | ||
| namespace = "Forms/Jobs" | ||
| metric_name = "FailedJobExecutions" | ||
| statistic = "Minimum" | ||
| period = 10 * 60 # 10 minutes | ||
| threshold = 1 | ||
|
|
||
| dimensions = { | ||
| Environment = "${var.environment}" | ||
| ServiceName = "forms-runner" | ||
| QueueName = "bounce_notifications" | ||
| } | ||
|
|
||
| treat_missing_data = "breaching" | ||
|
|
||
| alarm_actions = [local.alert_severity.eu_west_2.info] | ||
| ok_actions = [local.alert_severity.eu_west_2.info] | ||
| } |
32 changes: 32 additions & 0 deletions
32
infra/deployments/forms/health/alerts/schedule-bounce-notifications-job-not-run.tf
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| resource "aws_cloudwatch_metric_alarm" "schedule_bounce_notifications_job_not_run" { | ||
| alarm_name = "${var.environment}-schedule-bounce-notifications-job-not-run" | ||
| alarm_description = <<EOF | ||
| The forms-runner job to schedule sending notification emails to admin users about bounced submissions deliveries has | ||
| not run in the ${var.environment} environment in the past 25 hours. It is expected that the job is run every day. | ||
| This job is run by Solid Queue, which is started in the forms-runner-queue-worker ECS task. | ||
|
|
||
| NEXT STEPS: | ||
| 1. Check the Splunk logs and Sentry for any errors running the job. | ||
| 2. Restart the forms-runner-queue-worker ECS tasks and check whether the job starts running. | ||
| 3. Check that there haven't been any bounced submission deliveries that we should have sent notifications for in the time the job hasn't been running. If there are, make sure we send the notifications. | ||
|
|
||
| EOF | ||
| comparison_operator = "LessThanOrEqualToThreshold" | ||
| evaluation_periods = 25 | ||
| metric_name = "Started" | ||
| namespace = "Forms/Jobs" | ||
| period = 3600 | ||
| statistic = "SampleCount" | ||
| threshold = 0 | ||
|
|
||
| dimensions = { | ||
| Environment = "${var.environment}" | ||
| ServiceName = "forms-runner" | ||
| JobName = "ScheduleBounceNotificationsJob" | ||
| } | ||
|
|
||
| treat_missing_data = "breaching" | ||
|
|
||
| alarm_actions = [local.alert_severity.eu_west_2.info] | ||
| ok_actions = [local.alert_severity.eu_west_2.info] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.