File tree Expand file tree Collapse file tree
infrastructure/modules/container-apps Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ resource "azurerm_monitor_scheduled_query_rules_alert_v2" "five_hundred_error_alert" {
2+ count = var. enable_alerting ? 1 : 0
3+
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
16+
17+ action {
18+ action_groups = [var . action_group_id ]
19+ }
20+
21+ criteria {
22+ operator = " GreaterThan"
23+ query = <<- QUERY
24+ ContainerAppConsoleLogs_CL
25+ | where Log_s contains "500"
26+ QUERY
27+ threshold = 0
28+ time_aggregation_method = " Count"
29+
30+ failing_periods {
31+ minimum_failing_periods_to_trigger_alert = 1
32+ number_of_evaluation_periods = 1
33+ }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments