File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -357,3 +357,33 @@ resource "aws_cloudwatch_log_group" "pipe_log_group" {
357357 name = " /aws/vendedlogs/pipes/${ local . short_prefix } -pipe-logs"
358358 retention_in_days = 30
359359}
360+
361+ resource "aws_cloudwatch_log_metric_filter" "record_processor_task_error_logs" {
362+ count = var. batch_error_notifications_enabled ? 1 : 0
363+
364+ name = " ${ local . short_prefix } -RecordProcessorTaskErrorLogsFilter"
365+ pattern = " %ERROR:|CRITICAL:%"
366+ log_group_name = aws_cloudwatch_log_group. ecs_task_log_group . name
367+
368+ metric_transformation {
369+ name = " ${ local . short_prefix } -RecordProcessorTaskErrorLogs"
370+ namespace = " ${ local . short_prefix } -RecordProcessorTask"
371+ value = " 1"
372+ }
373+ }
374+
375+ resource "aws_cloudwatch_metric_alarm" "record_processor_task_error_alarm" {
376+ count = var. batch_error_notifications_enabled ? 1 : 0
377+
378+ alarm_name = " ${ local . short_prefix } -record-processor-task-error"
379+ comparison_operator = " GreaterThanOrEqualToThreshold"
380+ evaluation_periods = 1
381+ metric_name = " ${ local . short_prefix } -RecordProcessorTaskErrorLogs"
382+ namespace = " ${ local . short_prefix } -RecordProcessorTask"
383+ period = 120
384+ statistic = " Sum"
385+ threshold = 1
386+ alarm_description = " This sets off an alarm for any error logs found in the record processor ECS task"
387+ alarm_actions = [aws_sns_topic . batch_processor_errors . arn ]
388+ treat_missing_data = " notBreaching"
389+ }
You can’t perform that action at this time.
0 commit comments