File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -258,3 +258,33 @@ resource "aws_cloudwatch_log_group" "mesh_file_converter_log_group" {
258258 name = " /aws/lambda/${ local . short_prefix } -mesh_processor_lambda"
259259 retention_in_days = 30
260260}
261+
262+ resource "aws_cloudwatch_log_metric_filter" "mesh_processor_error_logs" {
263+ count = var. error_alarm_notifications_enabled ? 1 : 0
264+
265+ name = " ${ local . short_prefix } -MeshProcessorErrorLogsFilter"
266+ pattern = " %\\ [ERROR\\ ]%"
267+ log_group_name = aws_cloudwatch_log_group. mesh_file_converter_log_group [count . index ]. name
268+
269+ metric_transformation {
270+ name = " ${ local . short_prefix } -MeshProcessorErrorLogs"
271+ namespace = " ${ local . short_prefix } -MeshProcessorLambda"
272+ value = " 1"
273+ }
274+ }
275+
276+ resource "aws_cloudwatch_metric_alarm" "mesh_processor_error_alarm" {
277+ count = var. error_alarm_notifications_enabled ? 1 : 0
278+
279+ alarm_name = " ${ local . short_prefix } -mesh-processor-lambda-error"
280+ comparison_operator = " GreaterThanOrEqualToThreshold"
281+ evaluation_periods = 1
282+ metric_name = " ${ local . short_prefix } -MeshProcessorErrorLogs"
283+ namespace = " ${ local . short_prefix } -MeshProcessorLambda"
284+ period = 120
285+ statistic = " Sum"
286+ threshold = 1
287+ alarm_description = " This sets off an alarm for any error logs found in the mesh processor Lambda function"
288+ alarm_actions = [data . aws_sns_topic . imms_system_alert_errors . arn ]
289+ treat_missing_data = " notBreaching"
290+ }
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ resource "aws_cloudwatch_log_metric_filter" "redis_sync_error_logs" {
270270resource "aws_cloudwatch_metric_alarm" "redis_sync_error_alarm" {
271271 count = var. error_alarm_notifications_enabled ? 1 : 0
272272
273- alarm_name = " ${ local . short_prefix } -id -sync-lambda-error"
273+ alarm_name = " ${ local . short_prefix } -redis -sync-lambda-error"
274274 comparison_operator = " GreaterThanOrEqualToThreshold"
275275 evaluation_periods = 1
276276 metric_name = " ${ local . short_prefix } -RedisSyncErrorLogs"
You can’t perform that action at this time.
0 commit comments