From f79e4366169417d32b5efc4519093ce84a4ee6cf Mon Sep 17 00:00:00 2001 From: Guillaume Charest <1690085+gcharest@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:48:08 -0400 Subject: [PATCH] revert: alarm to avoid increase in cost (#659) --- terraform/alarms.tf | 31 ------------------------------- terraform/local.tf | 1 - terraform/queries.tf | 15 --------------- 3 files changed, 47 deletions(-) diff --git a/terraform/alarms.tf b/terraform/alarms.tf index f560ad7b..e1b747da 100644 --- a/terraform/alarms.tf +++ b/terraform/alarms.tf @@ -55,34 +55,3 @@ resource "aws_cloudwatch_metric_alarm" "sre_bot_warning" { alarm_actions = [aws_sns_topic.cloudwatch_warning.arn] ok_actions = [aws_sns_topic.cloudwatch_warning.arn] } - - -resource "aws_cloudwatch_log_metric_filter" "sre_bot_scheduled_tasks" { - name = local.scheduled_tasks_logged - pattern = "Scheduler is running at" - log_group_name = local.api_cloudwatch_log_group - - metric_transformation { - name = local.scheduled_tasks_logged - namespace = local.error_namespace - value = "1" - } -} - - -resource "aws_cloudwatch_metric_alarm" "sre_bot_scheduled_tasks" { - alarm_name = "SRE Bot Scheduled Tasks" - alarm_description = "SRE Bot Scheduled Tasks logs missing" - comparison_operator = "LessThanThreshold" - - metric_name = aws_cloudwatch_log_metric_filter.sre_bot_scheduled_tasks.metric_transformation[0].name - namespace = aws_cloudwatch_log_metric_filter.sre_bot_scheduled_tasks.metric_transformation[0].namespace - period = "300" - evaluation_periods = "2" - statistic = "Sum" - threshold = "1" - treat_missing_data = "breaching" - - alarm_actions = [aws_sns_topic.cloudwatch_warning.arn] - ok_actions = [aws_sns_topic.cloudwatch_warning.arn] -} \ No newline at end of file diff --git a/terraform/local.tf b/terraform/local.tf index f4895c60..18e858c7 100644 --- a/terraform/local.tf +++ b/terraform/local.tf @@ -3,5 +3,4 @@ locals { error_logged = "SREBotErrorLogged" error_namespace = "SREBot" warning_logged = "SREBotWarningLogged" - scheduled_tasks_logged = "SREBotScheduledTasksLogged" } diff --git a/terraform/queries.tf b/terraform/queries.tf index 3a7cf019..8f09358b 100644 --- a/terraform/queries.tf +++ b/terraform/queries.tf @@ -27,18 +27,3 @@ resource "aws_cloudwatch_query_definition" "api_warnings" { | limit 20 QUERY } - -resource "aws_cloudwatch_query_definition" "scheduled_tasks_errors" { - name = "SRE Bot Scheduled Tasks Logged" - - log_group_names = [ - local.api_cloudwatch_log_group - ] - - query_string = <<-QUERY - fields @timestamp, @message, @logStream - | filter @message like /Scheduler is running at/ - | sort @timestamp desc - | limit 20 - QUERY -}