Skip to content

Commit eb583c8

Browse files
authored
Ppha 810 create slack integration enable via schedule jobs (#454)
# What is the change? To avoid spamming the slack channel, we have decided to disable the scheduled jobs for the lower environments and to only have it enabled on prod. Also removed the 500 error alert as it does not correctly work. This will be fixed next week <!-- Describe the intended changes. --> # Why are we making this change? <!-- Why is this change required? What problem does it solve? -->
2 parents e6caaea + 05a31d0 commit eb583c8

2 files changed

Lines changed: 34 additions & 31 deletions

File tree

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
resource "azurerm_monitor_scheduled_query_rules_alert_v2" "five_hundred_error_alert" {
2-
count = var.enable_alerting ? 1 : 0
1+
# resource "azurerm_monitor_scheduled_query_rules_alert_v2" "five_hundred_error_alert" {
2+
# count = var.enable_alerting ? 1 : 0
33

4-
auto_mitigation_enabled = false
5-
description = "An alert triggered by 500 errors logged in code"
6-
enabled = var.enable_alerting
7-
evaluation_frequency = "PT5M"
8-
location = var.region
9-
name = "${var.app_short_name}-500-error-alert"
10-
resource_group_name = azurerm_resource_group.main.name
11-
scopes = [var.action_group_id]
12-
severity = 2
13-
skip_query_validation = false
14-
window_duration = "PT5M"
15-
workspace_alerts_storage_enabled = false
4+
# auto_mitigation_enabled = false
5+
# description = "An alert triggered by 500 errors logged in code"
6+
# enabled = var.enable_alerting
7+
# evaluation_frequency = "PT5M"
8+
# location = var.region
9+
# name = "${var.app_short_name}-500-error-alert"
10+
# resource_group_name = azurerm_resource_group.main.name
11+
# scopes = [var.action_group_id]
12+
# severity = 2
13+
# skip_query_validation = false
14+
# window_duration = "PT5M"
15+
# workspace_alerts_storage_enabled = false
1616

17-
action {
18-
action_groups = [var.action_group_id]
19-
}
17+
# action {
18+
# action_groups = [var.action_group_id]
19+
# }
2020

21-
criteria {
22-
operator = "GreaterThan"
23-
query = <<-QUERY
24-
ContainerAppConsoleLogs_CL
25-
| where Log contains "[ERROR]"
26-
QUERY
27-
threshold = 0
28-
time_aggregation_method = "Count"
21+
# criteria {
22+
# operator = "GreaterThan"
23+
# query = <<-QUERY
24+
# ContainerAppConsoleLogs_CL
25+
# | where Log contains "[ERROR]"
26+
# QUERY
27+
# threshold = 0
28+
# time_aggregation_method = "Count"
2929

30-
failing_periods {
31-
minimum_failing_periods_to_trigger_alert = 1
32-
number_of_evaluation_periods = 1
33-
}
34-
}
35-
}
30+
# failing_periods {
31+
# minimum_failing_periods_to_trigger_alert = 1
32+
# number_of_evaluation_periods = 1
33+
# }
34+
# }
35+
# }

infrastructure/modules/container-apps/jobs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ module "db_setup" {
4040
}
4141

4242
module "scheduled_jobs" {
43+
# TODO: This should be on a scheduled job bases and NOT for the entire module
44+
count = var.enable_alerting ? 1 : 0
45+
4346
source = "../dtos-devops-templates/infrastructure/modules/container-app-job"
4447

4548
for_each = local.scheduled_jobs

0 commit comments

Comments
 (0)