Skip to content

Commit 42f8fdf

Browse files
committed
Remove infra for collecting metrics
This includes the alert on queue sizes because there are no more queues
1 parent 0fbca21 commit 42f8fdf

File tree

5 files changed

+0
-71
lines changed

5 files changed

+0
-71
lines changed

infrastructure/modules/container-apps/alerts.tf

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,3 @@ resource "azurerm_monitor_scheduled_query_rules_alert_v2" "failure_event" {
3636
}
3737
}
3838
}
39-
40-
# IMPORTANT:
41-
# Enable metrics store with all dimensions: https://docs.azure.cn/en-us/azure-monitor/app/metrics-overview?tabs=standard#custom-metrics-dimensions-and-preaggregation
42-
# currently this feature is in preview.
43-
resource "azurerm_monitor_scheduled_query_rules_alert_v2" "queue_length_high" {
44-
for_each = var.enable_alerting ? toset([
45-
"notifications-message-batch-retries"
46-
]) : []
47-
48-
name = "${var.app_short_name}-${each.key}-${var.environment}-queue-length-high-alert"
49-
location = var.region
50-
resource_group_name = azurerm_resource_group.main.name
51-
52-
auto_mitigation_enabled = true
53-
description = "Alert when queue length exceeds ${var.queue_length_alert_threshold}"
54-
display_name = "${var.app_short_name} Notifications Queue Length High Alert"
55-
enabled = true
56-
severity = 2
57-
evaluation_frequency = "PT10M"
58-
window_duration = "PT10M"
59-
scopes = [var.app_insights_id]
60-
61-
criteria {
62-
query = <<-KQL
63-
customMetrics
64-
| where name == "${each.key}"
65-
| extend environment = tostring(customDimensions.environment)
66-
| where environment == "${var.environment}"
67-
| extend value = toreal(value)
68-
| summarize avg_value = avg(value) by bin(timestamp, 5m)
69-
| where avg_value > ${var.queue_length_alert_threshold}
70-
KQL
71-
72-
metric_measure_column = "avg_value"
73-
time_aggregation_method = "Average"
74-
operator = "GreaterThan"
75-
threshold = 0
76-
77-
failing_periods {
78-
minimum_failing_periods_to_trigger_alert = 1
79-
number_of_evaluation_periods = 1
80-
}
81-
}
82-
83-
action {
84-
action_groups = [var.action_group_id]
85-
}
86-
87-
tags = {
88-
environment = var.environment
89-
}
90-
}

infrastructure/modules/container-apps/jobs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ locals {
3333
job_short_name = "smk"
3434
job_container_args = "create_reports --smoke-test"
3535
}
36-
collect_metrics = {
37-
cron_expression = "*/5 * * * *"
38-
environment_variables = {
39-
ENVIRONMENT = var.environment
40-
}
41-
job_short_name = "clm"
42-
job_container_args = "collect_metrics"
43-
}
4436
}
4537
}
4638

infrastructure/modules/container-apps/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ variable "app_insights_id" {
199199
type = string
200200
}
201201

202-
variable "queue_length_alert_threshold" {
203-
description = "If alerting is enabled, alert if storage account queues are greater than this threshold."
204-
type = number
205-
}
206202

207203
variable "enable_notifications_jobs_schedule" {
208204
description = "Whether we apply the cron schedules for the notifications container app jobs"

infrastructure/terraform/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,5 @@ module "container-apps" {
7979
target_url = var.deploy_container_apps ? "${module.container-apps[0].external_url}healthcheck" : null
8080
resource_group_name_infra = local.resource_group_name
8181
enable_notifications_jobs_schedule = var.enable_notifications_jobs_schedule
82-
queue_length_alert_threshold = var.queue_length_alert_threshold
8382
min_replicas = var.min_replicas
8483
}

infrastructure/terraform/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ variable "run_notifications_smoke_test" {
185185
type = bool
186186
}
187187

188-
variable "queue_length_alert_threshold" {
189-
description = "If alerting is enabled, alert if storage account queues are greater than this threshold."
190-
type = number
191-
default = 5
192-
}
193-
194188
locals {
195189
region = "uksouth"
196190

0 commit comments

Comments
 (0)