Skip to content

Commit f1f18c3

Browse files
committed
final touches
1 parent ce3a870 commit f1f18c3

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

articles/load-balancer/load-balancer-monitor-metrics-cli.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,19 @@ For metric definitions and further details, refer to [Monitoring load balancer d
4444
## CLI examples for Load Balancer metrics
4545
<!-- Introduction paragraph -->
4646

47-
The [az monitor metrics](/cli/azure/monitor/metrics)command is used to view Azure resource metrics. To see what metrics are available for Standard Load Balancer resources, you run the `az monitor metrics list-definitions` command.
47+
The [az monitor metrics](/cli/azure/monitor/metrics) command is used to view Azure resource metrics. To see the metric definition available for a Standard Load Balancer, you run the `az monitor metrics list-definitions` command.
4848

4949
```azurecli
50-
# Display available metrics for Standard Load Balancer resources
50+
# Display available metric definitions for a Standard Load Balancer resource
5151
52-
az monitor metrics list-definitions
52+
az monitor metrics list-definitions --resource <ResourceName>
5353
```
5454

55-
To retrieve all Standard Load Balancer metrics available using CLI, you can use the `az monitor metrics list` command.
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}*.
5656

57-
```azurecli
58-
# Retrieve all available Standard Load Balancer metrics
59-
60-
az monitor metrics list
61-
```
57+
To retrieve Standard Load Balancer metrics for a resource, you can use the `az monitor metrics list` command.
6258

63-
Use `--metric DipAvailability` option to collect the Health Probe Status metric from a Standard Load Balancer. By default, az monitor metrics list returns the resource’s metrics from the last hour.
59+
For example, use the `--metric DipAvailability` option to collect the Health Probe Status metric from a Standard Load Balancer.
6460

6561
```azurecli
6662
@@ -69,26 +65,26 @@ Use `--metric DipAvailability` option to collect the Health Probe Status metric
6965
az monitor metrics list --resource <ResourceName> --metric DipAvailability
7066
```
7167

72-
When you run the above command, the output will appear as follows:
68+
When you run the above command, the output for Health Probe status will be like to the following output:
7369
```output
74-
...
70+
user@Azure:~$ az monitor metrics list --resource <ResourceName> --metric DipAvailability
7571
{
7672
"cost": 59,
7773
"interval": "0:01:00",
7874
"namespace": "Microsoft.Network/loadBalancers",
79-
"resourceregion": "eastus",
80-
"timespan": "2022-06-03T15:48:50Z/2022-06-03T16:48:50Z",
75+
"resourceregion": "eastus2",
76+
"timespan": "2022-06-30T15:22:39Z/2022-06-30T16:22:39Z",
8177
"value": [
8278
{
8379
"displayDescription": "Average Load Balancer health probe status per time duration",
8480
"errorCode": "Success",
8581
"errorMessage": null,
86-
"id": "/subscriptions/6a5f35e9-6951-499d-a36b-83c6c6eed44a/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/demoLB/providers/Microsoft.Insights/metrics/DipAvailability",
82+
"id": "/subscriptions/6a5f35e9-6951-499d-a36b-83c6c6eed44a/resourceGroups/myResourceGroup2/providers/Microsoft.Network/loadBalancers/myLoadBalancer/providers/Microsoft.Insights/metrics/DipAvailability",
8783
"name": {
8884
"localizedValue": "Health Probe Status",
8985
"value": "DipAvailability"
9086
},
91-
"resourceGroup": "myResourceGroup",
87+
"resourceGroup": "myResourceGroup2",
9288
"timeseries": [],
9389
"type": "Microsoft.Insights/metrics",
9490
"unit": "Count"
@@ -97,24 +93,23 @@ When you run the above command, the output will appear as follows:
9793
}
9894
...
9995
```
100-
You can specify the aggregation type for a metric with the –-aggregation parameter. For recommended aggregations, see Monitoring load balancer data reference](./monitor-load-balancer-reference.md).
96+
You can specify the aggregation type for a metric with the `–-aggregation` parameter. For recommended aggregations, see Monitoring load balancer data reference](./monitor-load-balancer-reference.md).
10197

10298
```azurecli
10399
104100
# List the average Health Probe Status metric from a Standard Load Balancer
105101
106102
az monitor metrics list --resource <ResourceName> --metric DipAvailability --aggregation Average
107103
```
108-
109-
To specify the interval to aggregate metrics, use the `--interval`` parameter and specify a value in ##h##m format. The default interval is
104+
To specify the interval to metrics, use the `--interval` parameter and specify a value in ##h##m format. The default interval is 1m.
110105

111106
```azurecli
112107
113108
# List the average List the average Health Probe Status metric from a Standard Load Balancer in 5 minute intervals
114109
115110
az monitor metrics list --resource <ResourceName> --metric DipAvailability --aggregation Average --interval 5m
116111
```
117-
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:
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:
118113

119114
```azurecli
120115
# List average Health Probe Status metric aggregated per day from May 5, 2022 and May 10, 2022.
@@ -130,23 +125,23 @@ To split metrics on a dimension, such as “BackendIPAddress”, specify the dim
130125
```azurecli
131126
# List average Health Probe Status metric and filter for all BackendIPAddress dimensions
132127
133-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter BackendIPAddress eq ‘*’” –aggregation Average
128+
az monitor metrics list --resource $res --metric DipAvailability --filter "BackendIPAddress eq '*'" --aggregation Average
134129
```
135130

136131
You can also specify a specific dimension value.
137132

138133
```azurecli
139134
# List average Health Probe Status metric and filter for the 10.1.0.4 BackendIPAddress dimension
140135
141-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter BackendIPAddress eq 10.1.0.4’” –aggregation Average
136+
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter "BackendIPAddress eq '10.1.0.4'" --aggregation Average
142137
```
143138

144139
In cases where you need to filter on multiple dimension values, specify the `--filter` value using `and` between the values.
145140

146141
```azurecli
147142
# List average Health Probe Status metric and filter for all BackendIPAddress and BackendPort dimensions
148143
149-
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter BackendIPAddress eq ‘*’ and BackendPort eq ‘*’” –aggregation Average
144+
az monitor metrics list --resource <ResourceName> --metric DipAvailability --filter "BackendIPAddress eq '*' and BackendPort eq '*'" --aggregation Average
150145
```
151146

152147
## Next steps

0 commit comments

Comments
 (0)