Monitor Azure Load Balancer
Effective monitoring ensures your load‑balancing solution remains reliable, performant, and cost‑effective. Azure provides built‑in metrics, alerts, and diagnostics that you can integrate with Azure Monitor, Log Analytics, and third‑party tools.
Metrics
Alerts
Diagnostics
Example
Key Metrics
- DipAvailability – Percentage of successful health probe responses.
- DipTxBytes/DipRxBytes – Data transmitted/received by the load balancer.
- DipActiveConnections – Current active TCP/UDP connections.
- DipNewConnectionCount – New connections per second.
All metrics are available in Azure Monitor under the Microsoft.Network/loadBalancers
resource type.
Creating Alerts
Set up alerts to proactively respond to unhealthy back‑ends or traffic spikes.
- Open Azure Monitor → Alerts → New alert rule.
- Select your Load Balancer as the resource.
- Choose a metric (e.g., DipAvailability).
- Define condition (e.g., Less than 95% for 5 minutes).
- Configure action group (email, webhook, etc.) and save.
{
"condition": {
"metricName": "DipAvailability",
"operator": "LessThan",
"threshold": 95,
"windowSize": "PT5M"
},
"actionGroupId": "/subscriptions/.../resourceGroups/.../providers/microsoft.insights/actionGroups/MyAlerts"
}
Diagnostics Settings
Enable diagnostics to capture detailed logs and flow logs.
- Go to the Load Balancer blade → Diagnostics settings.
- Click Add diagnostic setting and select Metrics and Log Analytics workspace.
- Optionally enable Network Security Group flow logs for deeper packet‑level analysis.
Logs can be queried with Kusto Query Language (KQL):
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK"
| where Category == "LoadBalancerAlert"
| summarize count() by bin(TimeGenerated, 5m), AlertName
End‑to‑End Monitoring Example
This script creates a metric alert for low availability and sends a Teams notification.
az monitor metrics alert create \
--name "LB-Availability-Alert" \
--resource-group MyRG \
--scopes /subscriptions//resourceGroups/MyRG/providers/Microsoft.Network/loadBalancers/myLB \
--condition "avg DipAvailability < 95" \
--description "Alert when Load Balancer availability drops below 95%" \
--action /subscriptions//resourceGroups/MyRG/providers/microsoft.insights/actionGroups/TeamsNotify
After deployment, view the alert in Azure Monitor → Alerts → Active alerts.