Skip to content

Commit 600bda1

Browse files
authored
Merge pull request #2119 from govuk-forms/add-alerts-for-bounce-notifications-jobs
Add alerts for bounce notifications jobs
2 parents eac99bb + f2441e3 commit 600bda1

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
resource "aws_cloudwatch_metric_alarm" "failed_bounce_notifications_job_executions" {
2+
alarm_name = "${var.environment}-failed-bounce-notifications-job-executions"
3+
alarm_description = <<EOF
4+
There are one or more failed job executions for the bounce_notifications queue in forms-runner in the ${var.environment}
5+
environment that will not automatically be retried.
6+
7+
Follow the runbook to respond to this: https://github.com/govuk-forms/forms-team/wiki/Runbooks#handle-failed-solid-queue-jobs
8+
9+
Only close this Zendesk ticket when we get another Zendesk ticket to tell us that the alarm is in the OK state.
10+
EOF
11+
comparison_operator = "GreaterThanOrEqualToThreshold"
12+
evaluation_periods = 1
13+
namespace = "Forms/Jobs"
14+
metric_name = "FailedJobExecutions"
15+
statistic = "Minimum"
16+
period = 10 * 60 # 10 minutes
17+
threshold = 1
18+
19+
dimensions = {
20+
Environment = "${var.environment}"
21+
ServiceName = "forms-runner"
22+
QueueName = "bounce_notifications"
23+
}
24+
25+
treat_missing_data = "breaching"
26+
27+
alarm_actions = [local.alert_severity.eu_west_2.info]
28+
ok_actions = [local.alert_severity.eu_west_2.info]
29+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "aws_cloudwatch_metric_alarm" "schedule_bounce_notifications_job_not_run" {
2+
alarm_name = "${var.environment}-schedule-bounce-notifications-job-not-run"
3+
alarm_description = <<EOF
4+
The forms-runner job to schedule sending notification emails to admin users about bounced submissions deliveries has
5+
not run in the ${var.environment} environment in the past 25 hours. It is expected that the job is run every day.
6+
This job is run by Solid Queue, which is started in the forms-runner-queue-worker ECS task.
7+
8+
NEXT STEPS:
9+
1. Check the Splunk logs and Sentry for any errors running the job.
10+
2. Restart the forms-runner-queue-worker ECS tasks and check whether the job starts running.
11+
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.
12+
13+
EOF
14+
comparison_operator = "LessThanOrEqualToThreshold"
15+
evaluation_periods = 25
16+
metric_name = "Started"
17+
namespace = "Forms/Jobs"
18+
period = 3600
19+
statistic = "SampleCount"
20+
threshold = 0
21+
22+
dimensions = {
23+
Environment = "${var.environment}"
24+
ServiceName = "forms-runner"
25+
JobName = "ScheduleBounceNotificationsJob"
26+
}
27+
28+
treat_missing_data = "breaching"
29+
30+
alarm_actions = [local.alert_severity.eu_west_2.info]
31+
ok_actions = [local.alert_severity.eu_west_2.info]
32+
}

0 commit comments

Comments
 (0)