You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/load-balancer/load-balancer-monitor-metrics-cli.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,10 +49,10 @@ The [az monitor metrics](cli/azure/monitor/metrics) command is used to view Azur
49
49
```azurecli
50
50
# Display available metric definitions for a Standard Load Balancer resource
51
51
52
-
az monitor metrics list-definitions --resource <ResourceName>
52
+
az monitor metrics list-definitions --resource <resource_id>
53
53
```
54
-
55
-
In the above example and the following examples, replace **<ResourceName>** with the value of your Standard Load Balancer resource in the format of */subscriptions/{subscriptionID}/resourceGroups/{resourceGroup}/Microsoft.Network/networkSecurityGroups/{resourceName}*.
54
+
>[!NOTE]
55
+
>In the all the following examples, replace **<resource_id>** with the unique resource id of your Standard Load Balancer.
56
56
57
57
To retrieve Standard Load Balancer metrics for a resource, you can use the `az monitor metrics list` command.
58
58
@@ -62,12 +62,12 @@ For example, use the `--metric DipAvailability` option to collect the Health Pro
62
62
63
63
# List the Health Probe Status metric from a Standard Load Balancer
64
64
65
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability
65
+
az monitor metrics list --resource <resource_id> --metric DipAvailability
66
66
```
67
67
68
68
When you run the above command, the output for Health Probe status will be like to the following output:
69
69
```output
70
-
user@Azure:~$ az monitor metrics list --resource <ResourceName> --metric DipAvailability
70
+
user@Azure:~$ az monitor metrics list --resource <resource_id> --metric DipAvailability
71
71
{
72
72
"cost": 59,
73
73
"interval": "0:01:00",
@@ -99,22 +99,22 @@ You can specify the aggregation type for a metric with the `–-aggregation` par
99
99
100
100
# List the average Health Probe Status metric from a Standard Load Balancer
101
101
102
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --aggregation Average
102
+
az monitor metrics list --resource <resource_id> --metric DipAvailability --aggregation Average
103
103
```
104
104
To specify the interval to metrics, use the `--interval` parameter and specify a value in ##h##m format. The default interval is 1m.
105
105
106
106
```azurecli
107
107
108
108
# List the average List the average Health Probe Status metric from a Standard Load Balancer in 5 minute intervals
109
109
110
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --aggregation Average --interval 5m
110
+
az monitor metrics list --resource <resource_id> --metric DipAvailability --aggregation Average --interval 5m
111
111
```
112
112
By default, az monitor metrics list returns the resource’s aggregate metrics from the last hour. You can query metric data over a period of time using `--start-time` and `--end-time` with the format of date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm). To list the average Health Probe Status aggregated per day from May 5, 2022 and May 10, 2022, use the following command:
113
113
114
114
```azurecli
115
115
# List average Health Probe Status metric aggregated per day from May 5, 2022 and May 10, 2022.
116
116
117
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --start-time 2022-05-01T00:00:00Z --end-time 2022-05-10T00:00:00Z --interval PT24H --aggregation Average
117
+
az monitor metrics list --resource <resource_id> --metric DipAvailability --start-time 2022-05-01T00:00:00Z --end-time 2022-05-10T00:00:00Z --interval PT24H --aggregation Average
118
118
```
119
119
>[!Note]
120
120
>Start and end times are represented using a format of yyyy-mm-dd format. For example, every day between May 5, 2022 and May 10, 2022 would be represented as `2022-05-01` and `2022-05-10`.
@@ -133,15 +133,15 @@ You can also specify a specific dimension value.
133
133
```azurecli
134
134
# List average Health Probe Status metric and filter for the 10.1.0.4 BackendIPAddress dimension
135
135
136
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter "BackendIPAddress eq '10.1.0.4'" --aggregation Average
136
+
az monitor metrics list --resource <resource_id> --metric DipAvailability --filter "BackendIPAddress eq '10.1.0.4'" --aggregation Average
137
137
```
138
138
139
139
In cases where you need to filter on multiple dimension values, specify the `--filter` value using `and` between the values.
140
140
141
141
```azurecli
142
142
# List average Health Probe Status metric and filter for all BackendIPAddress and BackendPort dimensions
143
143
144
-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter "BackendIPAddress eq '*' and BackendPort eq '*'" --aggregation Average
144
+
az monitor metrics list --resource <resource_id> --metric DipAvailability --filter "BackendIPAddress eq '*' and BackendPort eq '*'" --aggregation Average
0 commit comments