Skip to content

Commit

Permalink
revert: alarm to avoid increase in cost (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharest authored Sep 20, 2024
1 parent 536175f commit f79e436
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
31 changes: 0 additions & 31 deletions terraform/alarms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
1 change: 0 additions & 1 deletion terraform/local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ locals {
error_logged = "SREBotErrorLogged"
error_namespace = "SREBot"
warning_logged = "SREBotWarningLogged"
scheduled_tasks_logged = "SREBotScheduledTasksLogged"
}
15 changes: 0 additions & 15 deletions terraform/queries.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit f79e436

Please sign in to comment.