Is there a way to create 1 custom alert rule for CrashLoopBackOff (as an example) which will be triggering multiple alerts. All alerts will be identical, but pod names will be different.
In Prometheus we receive alerts by each pod, but I`m not sure if it is possible to achieve in Azure Application Insights.
You can use “Alert rule” to archive it. Insight itself does not have feature to alert.
Steps:
KubePodInventory
| where ContainerStatus == 'waiting'
// | where Name contains "microsoft-defender-"
| extend ContainerLastStatus=todynamic(ContainerLastStatus)
| summarize RestartCount = arg_max(ContainerRestartCount, Computer, Namespace, ContainerStatusReason) by Name
(Note: uncomment the 3rd line: “| where Name contains "microsoft-defender-"”, modify the name to whatever you want.)