Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions infra/modules/shared/monitoring.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ resource ErrorLogAlerts 'Microsoft.Insights/scheduledQueryRules@2023-03-15-previ
location: location
properties: {
displayName: 'Error Log Alert'
description: 'Log alert for errors'
description: 'Log alert for errors in containers'
enabled: true
criteria: {
allOf: [
{
query: '''
ContainerAppConsoleLogs_CL
| where Log_s contains "Error"
| project TimeGenerated, _timestamp_d, ContainerAppName_s
'''
timeAggregation: 'Count'
operator: 'GreaterThan'
Expand All @@ -164,14 +165,15 @@ resource WarningLogAlerts 'Microsoft.Insights/scheduledQueryRules@2023-03-15-pre
location: location
properties: {
displayName: 'Warning Log Alert'
description: 'Log alert for warnings'
description: 'Log alert for warnings in containers'
enabled: true
criteria: {
allOf: [
{
query: '''
ContainerAppConsoleLogs_CL
| where Log_s contains "Warning"
| project TimeGenerated, _timestamp_d, ContainerAppName_s
'''
timeAggregation: 'Count'
operator: 'GreaterThan'
Expand All @@ -196,7 +198,7 @@ resource ContainerTerminated 'Microsoft.Insights/scheduledQueryRules@2023-03-15-
location: location
properties: {
displayName: 'Warning Log Alert'
description: 'Log alert for warnings'
description: 'Log alert for warnings for containers'
enabled: true
criteria: {
allOf: [
Expand All @@ -205,7 +207,7 @@ resource ContainerTerminated 'Microsoft.Insights/scheduledQueryRules@2023-03-15-
ContainerAppSystemLogs_CL
| where Log_s contains "readiness probe failed: connection refused"
| where TimeGenerated > ago(5m)
| project TimeGenerated, ContainerAppName_s, Log_s
| project TimeGenerated, _timestamp_d, ContainerAppName_s
'''
timeAggregation: 'Count'
operator: 'GreaterThan'
Expand Down
Loading