Skip to content

Commit

Permalink
count added to logs to makesure they are only added on mesh-forwarder…
Browse files Browse the repository at this point in the history
… enabled status (#127)

Co-authored-by: Scott Alexander <[email protected]>
  • Loading branch information
SRAlexander and Scott Alexander authored Jan 8, 2024
1 parent 89a7481 commit 0cbd013
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions infrastructure/mesh-forwarder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ resource "aws_cloudwatch_log_group" "mesh_log_group" {
}

resource "aws_cloudwatch_log_metric_filter" "inbox_message_count" {
count = local.is_mesh_forwarder_enable ? 1 : 0
name = "${var.environment}-mesh-inbox-message-count"
pattern = "{ $.event = \"COUNT_MESSAGES\" }"
log_group_name = aws_cloudwatch_log_group.mesh_log_group[0].name
Expand Down Expand Up @@ -409,6 +410,7 @@ resource "aws_cloudwatch_metric_alarm" "inbox-messages-not-consumed" {
}

resource "aws_cloudwatch_log_metric_filter" "error_log_metric_filter" {
count = local.is_mesh_forwarder_enable ? 1 : 0
name = "${var.environment}-${var.mesh_component_name}-error-logs"
pattern = "{ $.error = * }"
log_group_name = aws_cloudwatch_log_group.mesh_log_group[0].name
Expand Down

0 comments on commit 0cbd013

Please sign in to comment.