From dfaeb5c97fd797e4f4c4edfab0af9a542dff9b8e Mon Sep 17 00:00:00 2001 From: Ben Larabie Date: Tue, 11 Jun 2024 13:32:49 -0400 Subject: [PATCH] Making the github arc runner alarm more generic and scoped to runners only --- aws/eks/cloudwatch_alarms.tf | 10 +++++----- aws/eks/cloudwatch_log.tf | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aws/eks/cloudwatch_alarms.tf b/aws/eks/cloudwatch_alarms.tf index 0ae7eafdb..7c4209686 100644 --- a/aws/eks/cloudwatch_alarms.tf +++ b/aws/eks/cloudwatch_alarms.tf @@ -939,14 +939,14 @@ resource "aws_cloudwatch_metric_alarm" "aggregating-queues-not-active-5-minutes- ok_actions = [var.sns_alert_critical_arn] } -resource "aws_cloudwatch_metric_alarm" "github-arc-runner-write-alarm" { +resource "aws_cloudwatch_metric_alarm" "github-arc-runner-error-alarm" { count = var.cloudwatch_enabled ? 1 : 0 - alarm_name = "github-arc-runner-write-alarm" - alarm_description = "GitHub ARC Runners Are Failing - Check Version Deprecation" + alarm_name = "github-arc-runner-error-alarm" + alarm_description = "GitHub ARC Runners Are Failing" comparison_operator = "LessThanThreshold" evaluation_periods = "1" - metric_name = aws_cloudwatch_log_metric_filter.github-arc-write-alarm[0].metric_transformation[0].name - namespace = aws_cloudwatch_log_metric_filter.github-arc-write-alarm[0].metric_transformation[0].namespace + metric_name = aws_cloudwatch_log_metric_filter.github-arc-runner-alarm[0].metric_transformation[0].name + namespace = aws_cloudwatch_log_metric_filter.github-arc-runner-alarm[0].metric_transformation[0].namespace period = "300" statistic = "Sum" threshold = 1 diff --git a/aws/eks/cloudwatch_log.tf b/aws/eks/cloudwatch_log.tf index 44344df84..c4503f6e8 100644 --- a/aws/eks/cloudwatch_log.tf +++ b/aws/eks/cloudwatch_log.tf @@ -167,14 +167,14 @@ resource "aws_cloudwatch_log_metric_filter" "aggregating-queues-are-active" { } } -resource "aws_cloudwatch_log_metric_filter" "github-arc-write-alarm" { +resource "aws_cloudwatch_log_metric_filter" "github-arc-runner-alarm" { count = var.cloudwatch_enabled ? 1 : 0 name = "GitHub ARC Runners Write Alarm" - pattern = "WRITE ERROR" + pattern = "{ $.kubernetes.pod_name = \"github-arc-ss-${var.env}-*-runner-*\" && $.log = \"*ERROR*\" }" log_group_name = aws_cloudwatch_log_group.notification-canada-ca-eks-application-logs[0].name metric_transformation { - name = "aggregating-github-arc-write-alarm" + name = "aggregating-github-arc-runner-alarm" namespace = "LogMetrics" value = "1" }