Skip to content

Commit 7646050

Browse files
author
Jill Grant
authored
Merge pull request #233255 from mukesh-dua/main
Added doc for MetricsConfiguration resource
2 parents 3925e40 + 0189f9a commit 7646050

File tree

4 files changed

+200
-1
lines changed

4 files changed

+200
-1
lines changed

articles/operator-nexus/TOC.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@
4444
href: howto-monitor-aks-h-cluster.md
4545
- name: Monitor VMs for VNF
4646
href: howto-monitor-virtualized-network-functions-virtual-machines.md
47+
- name: Cluster metrics configuration management
48+
href: howto-cluster-metrics-configuration-management.md
4749
- name: Pre-certification
4850
href: howto-precertification.md
51+
- name: Tracking asynchronous operations
52+
href: howto-track-async-operations-cli.md
4953
- name: Sample Deployment
5054
items:
5155
- name: VNF Deployment
@@ -56,6 +60,6 @@
5660
items:
5761
- name: Instance to On-Premises WAN Connectivity
5862
href: reference-customer-edge-provider-edge-connectivity.md
59-
- name: List of Metrics Collected
63+
- name: List of metrics collected
6064
href: List-of-metrics-collected.md
6165

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: "Azure Operator Nexus: How to configure cluster metrics configuration management"
3+
description: Instructional for the inputs and methods for creating, updating, retrieving, and deleting cluster metrics configurations.
4+
author: bryan-strassner
5+
ms.author: bstrassner
6+
ms.service: azure
7+
ms.topic: how-to
8+
ms.date: 02/09/2023
9+
ms.custom: template-how-to
10+
---
11+
12+
# Cluster metrics configuration
13+
14+
When the user deploys a Cluster, a standard set of metrics are enabled for collection. For the list of metrics, see
15+
[List of Metrics Collected](List-of-metrics-collected.md).
16+
17+
Users can't control the behavior (enable or disable) for collection of these included standard metrics. Though, users can control the collection of some optional metrics that aren't part of the link in the list. To enable this experience, users will have to create and update a MetricsConfiguration resource for a cluster. By default, creation of this MetricsConfiguration resource doesn't change the collection of metrics. User will have to update the resource to enable or disable these optional metrics collection.
18+
19+
> [!NOTE]
20+
> * For a cluster, at max, only one MetricsConfiguration resource could be created.
21+
> * Users need to create a MetricsConfiguration resource to check a list of optional metrics that can be controlled.
22+
> * Deletion of the MetricsConfiguration resource will result in the standard set of metrics being restored.
23+
24+
## How to manage cluster metrics configuration
25+
26+
To support the lifecycle of cluster metrics configurations, the following `az rest` interactions allow for the creation and management of a cluster's metrics configurations.
27+
28+
### Creating a metrics configuration
29+
30+
Use of the `az rest` command requires that the request input is defined, and then a `PUT` request is made to the `Microsoft.NetworkCloud` resource provider.
31+
32+
Define a file with the desired metrics configuration.
33+
34+
* Replace values within `<` `>` with your specific information.
35+
* Query the cluster resource and find the value of `<CLUSTER-EXTENDED-LOCATION-ID>` in the `properties.clusterExtendedLocation`
36+
* The `collectionInterval` field is required, `enabledMetrics` is optional and may be omitted.
37+
38+
Example filename: create_metrics_configuration.json
39+
40+
```json
41+
{
42+
"location": "<REGION (example: eastus)>",
43+
"extendedLocation": {
44+
"name": "<CLUSTER-EXTENDED-LOCATION-ID>",
45+
"type": "CustomLocation"
46+
},
47+
"properties": {
48+
"collectionInterval": <COLLECTION-INTERVAL (1-1440)>,
49+
"enabledMetrics": [
50+
"<METRIC-TO-ENABLE-1>",
51+
"<METRIC-TO-ENABLE-2>"
52+
]
53+
}
54+
}
55+
```
56+
57+
The following commands will create the metrics configuration. The only name allowed for the metricsConfiguration is `default`.
58+
59+
```sh
60+
export SUBSCRIPTION=<the subscription id for the cluster>
61+
export RESOURCE_GROUP=<the resource group for the cluster>
62+
export CLUSTER=<the cluter name>
63+
64+
az rest -m put -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" -b @create_metrics_configuration.json --debug
65+
```
66+
67+
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
68+
69+
## Retrieving a metrics configuration
70+
71+
After a metrics configuration is created, it can be retrieved using a `az rest` command:
72+
73+
```sh
74+
export SUBSCRIPTION=<the subscription id for the cluster>
75+
export RESOURCE_GROUP=<the resource group for the cluster>
76+
export CLUSTER=<the cluter name>
77+
78+
az rest -m get -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview"
79+
```
80+
81+
This command will return a JSON representation of the metrics configuration.
82+
83+
## Updating a metrics configuration
84+
85+
Much like the creation of a metrics configuration, an update can be performed to change the configuration. A file, containing the metrics to be updated, is consumed as an input.
86+
87+
Example filename: update_metrics_configuration.json
88+
89+
```json
90+
{
91+
"properties": {
92+
"collectionInterval": <COLLECTION-INTERVAL (1-1440)>,
93+
"enabledMetrics": [
94+
"<METRIC-TO-ENABLE-1>",
95+
"<METRIC-TO-ENABLE-2>"
96+
]
97+
}
98+
}
99+
```
100+
101+
This file is used as input to an `az rest` command. The change may include either or both of the updatable fields, `collectionInterval` or `enabledMetrics`. The `collectionInterval` can be updated independently of `enabledMetrics`. Omit fields that aren't being changed.
102+
103+
```sh
104+
export SUBSCRIPTION=<the subscription id for the cluster>
105+
export RESOURCE_GROUP=<the resource group for the cluster>
106+
export CLUSTER=<the cluter name>
107+
108+
az rest -m put -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" -b @update_metrics_configuration.json --debug
109+
```
110+
111+
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
112+
113+
## Deleting a metrics configuration
114+
115+
Deletion of the metrics configuration will return the cluster to an unaltered configuration. To delete a metrics configuration, `az rest` API is used.
116+
117+
```sh
118+
export SUBSCRIPTION=<the subscription id for the cluster>
119+
export RESOURCE_GROUP=<the resource group for the cluster>
120+
export CLUSTER=<the cluter name>
121+
122+
az rest -m delete -u "https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.NetworkCloud/clusters/${CLUSTER}/metricsConfigurations/default?api-version=2022-12-12-preview" --debug
123+
```
124+
125+
Specifying `--debug` in REST API will result in the tracking operation status in the returned command output. This operation status can be queried to monitor the progress of the operation. See: [How-to track asynchronous operations](howto-track-async-operations-cli.md).
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Tracking Asynchronous Operations Using Azure CLI
3+
description: Instructions for how an asynchronous operation status may be discovered, tracked, and used to determine completion.
4+
author: bryan-strassner
5+
ms.author: bstrassner
6+
ms.service: azure
7+
ms.topic: how-to
8+
ms.date: 02/09/2023
9+
ms.custom: template-how-to
10+
---
11+
12+
# Tracking asynchronous operations using Azure CLI
13+
14+
Some Azure CLI operations are asynchronous. To track the status of an asynchronous operation, the `operationStatuses` resource can be used. Asynchronous commands can be run with a `--debug` flag enabled. When `--debug` is specified, the progress of the request can be monitored. The operation status URL can be found by examining the `Azure-AsyncOperation` or `Location` header on the HTTP response to the creation request.
15+
16+
```output
17+
... many lines of logged information ...
18+
19+
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/.../resourceGroups/.../providers/Microsoft.NetworkCloud/clusters/.../metricsConfigurations/default?api-version=2022-12-12-preview HTTP/1.1" 201 926
20+
cli.azure.cli.core.util: Response status: 201
21+
cli.azure.cli.core.util: Response headers:
22+
23+
... several lines of http headers of the response ...
24+
25+
cli.azure.cli.core.util: 'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/.../providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/12312312-1231-1231-1231-123123123123*99399E995...?api-version=2022-12-12-preview'
26+
27+
... remaining http headers of the response and more lines of logging ...
28+
```
29+
30+
Using the value from before:
31+
`https://management.azure.com/subscriptions/.../providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/12312312-1231-1231-1231-123123123123*99399E995...?api-version=2022-12-12-preview`, an Azure CLI `az rest` call can be issued to retrieve the operation status.
32+
33+
```sh
34+
az rest -m get -u "https://management.azure.com/subscriptions/.../providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/12312312-1231-1231-1231-123123123123*99399E995...?api-version=2022-12-12-preview"
35+
```
36+
37+
This request will return an operation status result that can be requeried using the same command until the status reaches a final state of `Succeeded` or `Failed`. At this point, the requested operation has ceased.
38+
39+
```json
40+
{
41+
"endTime": "2023-02-08T17:38:31.2042934Z",
42+
"error": {},
43+
"id": "subscriptions/.../providers/Microsoft.NetworkCloud/locations/EASTUS/operationStatuses/12312312-1231-1231-1231-123123123123*99399E995...?api-version=2022-12-12-preview",
44+
"name": "12312312-1231-1231-1231-123123123123*99399E995...",
45+
"properties": null,
46+
"resourceId": "subscriptions/.../resourceGroups/.../providers/Microsoft.NetworkCloud/clusters/.../metricsConfigurations/default?api-version=2022-12-12-preview",
47+
"startTime": "2023-02-08T17:38:24.7576911Z",
48+
"status": "Succeeded"
49+
}
50+
```

articles/operator-nexus/index.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ landingContent:
5454
url: quickstarts-tenant-workload-prerequisites.md
5555
- text: Tenant workload deployment
5656
url: quickstarts-tenant-workload-deployment.md
57+
#
58+
# Card
59+
- title: Observability
60+
linkLists:
61+
- linkListType: concept
62+
links:
63+
- text: Observability concepts
64+
url: concepts-observability.md
65+
- linkListType: how-to-guide
66+
links:
67+
- text: Monitor AKS-Hybrid Cluster
68+
url: howto-monitor-aks-h-cluster.md
69+
- text: Monitor VMs for VNF
70+
url: howto-monitor-virtualized-network-functions-virtual-machines.md
71+
- text: Cluster metrics configuration management
72+
url: howto-cluster-metrics-configuration-management.md
73+
- linkListType: reference
74+
links:
75+
- text: List of metrics collected
76+
url: List-of-metrics-collected.md
5777
#
5878
# Card
5979
# - title: How-to guides

0 commit comments

Comments
 (0)