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/azure-monitor/essentials/prometheus-metrics-enable.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,14 +49,14 @@ Use `az aks update` with the `-enable-azuremonitormetrics` option to install the
49
49
50
50
**Create a new default Azure Monitor workspace.**<br>
51
51
If no Azure Monitor Workspace is specified, then a default Azure Monitor Workspace will be created in the `DefaultRG-<cluster_region>` following the format `DefaultAzureMonitorWorkspace-<mapped_region>`.
52
-
This Azure Monitor Workspace will be in the region specific in [Region mappings](#region-mappings).
52
+
This Azure Monitor Workspace is in the region specific in [Region mappings](#region-mappings).
53
53
54
54
```azurecli
55
55
az aks update --enable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group>
56
56
```
57
57
58
58
**Use an existing Azure Monitor workspace.**<br>
59
-
If the Azure Monitor workspace is linked to one or more Grafana workspaces, then the data will be available in Grafana.
59
+
If the Azure Monitor workspace is linked to one or more Grafana workspaces, then the data is available in Grafana.
60
60
61
61
```azurecli
62
62
az aks update --enable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group> --azure-monitor-workspace-resource-id <workspace-name-resource-id>
@@ -69,7 +69,7 @@ This creates a link between the Azure Monitor workspace and the Grafana workspac
69
69
az aks update --enable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group> --azure-monitor-workspace-resource-id <azure-monitor-workspace-name-resource-id> --grafana-resource-id <grafana-workspace-name-resource-id>
70
70
```
71
71
72
-
The output for each command will look similar to the following:
72
+
The output for each command looks similar to the following:
73
73
74
74
```json
75
75
"azureMonitorProfile": {
@@ -86,16 +86,16 @@ The output for each command will look similar to the following:
86
86
#### Optional parameters
87
87
Following are optional parameters that you can use with the previous commands.
88
88
89
-
-`--ksm-metric-annotations-allow-list` is a comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. By default the metric contains only name and namespace labels. To include additional annotations provide a list of resource names in their plural form and Kubernetes annotation keys, you would like to allow for them. A single `*` can be provided per resource instead to allow any annotations, but that has severe performance implications.
90
-
-`--ksm-metric-labels-allow-list` is a comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them. A single `*` can be provided per resource instead to allow any labels, but that has severe performance implications.
89
+
-`--ksm-metric-annotations-allow-list` is a comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. By default the metric contains only name and namespace labels. To include more annotations provide a list of resource names in their plural form and Kubernetes annotation keys, you would like to allow for them. A single `*` can be provided per resource instead to allow any annotations, but that has severe performance implications.
90
+
-`--ksm-metric-labels-allow-list` is a comma-separated list of more Kubernetes label keys that will be used in the resource's labels metric. By default the metric contains only name and namespace labels. To include more labels provide a list of resource names in their plural form and Kubernetes label keys, you would like to allow for them. A single `*` can be provided per resource instead to allow any labels, but that has severe performance implications.
91
91
92
92
**Use annotations and labels.**
93
93
94
94
```azurecli
95
95
az aks update --enable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group> --ksm-metric-labels-allow-list "namespaces=[k8s-label-1,k8s-label-n]" --ksm-metric-annotations-allow-list "pods=[k8s-annotation-1,k8s-annotation-n]"
96
96
```
97
97
98
-
The output will be similar to the following:
98
+
The output is similar to the following:
99
99
100
100
```json
101
101
"azureMonitorProfile": {
@@ -122,7 +122,7 @@ The output will be similar to the following:
122
122
### Retrieve required values for Grafana resource
123
123
From the **Overview** page for the Azure Managed Grafana instance in the Azure portal, select **JSON view**.
124
124
125
-
If you're using an existing Azure Managed Grafana instance that already has been linked to an Azure Monitor workspace then you need the list of Grafana integrations. Copy the value of the `azureMonitorWorkspaceIntegrations` field. If it doesn't exist, then the instance hasn't been linked with any Azure Monitor workspace.
125
+
If you're using an existing Azure Managed Grafana instance that already has been linked to an Azure Monitor workspace, then you need the list of Grafana integrations. Copy the value of the `azureMonitorWorkspaceIntegrations` field. If it doesn't exist, then the instance hasn't been linked with any Azure Monitor workspace.
126
126
127
127
```json
128
128
"properties": {
@@ -152,13 +152,13 @@ If you're using an existing Azure Managed Grafana instance that already has been
152
152
|`clusterResourceId`| Resource ID for the AKS cluster. Retrieve from the **JSON view** on the **Overview** page for the cluster. |
153
153
|`clusterLocation`| Location of the AKS cluster. Retrieve from the **JSON view** on the **Overview** page for the cluster. |
154
154
|`metricLabelsAllowlist`| Comma-separated list of Kubernetes labels keys that will be used in the resource's labels metric. |
155
-
|`metricAnnotationsAllowList`| Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. |
155
+
|`metricAnnotationsAllowList`| Comma-separated list of more Kubernetes label keys that will be used in the resource's labels metric. |
156
156
|`grafanaResourceId`| Resource ID for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. |
157
157
|`grafanaLocation`| Location for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. |
158
158
|`grafanaSku`| SKU for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. Use the **sku.name**. |
159
159
160
160
161
-
4. Open the template file and update the `grafanaIntegrations` property at the end of the file with the values that you retrieved from the Grafana instance. This will be similar to the following:
161
+
4. Open the template file and update the `grafanaIntegrations` property at the end of the file with the values that you retrieved from the Grafana instance. This is similar to the following:
162
162
163
163
```json
164
164
{
@@ -207,7 +207,7 @@ Currently in bicep, there is no way to explicitly "scope" the Monitoring Data Re
207
207
208
208
From the **Overview** page for the Azure Managed Grafana instance in the Azure portal, select **JSON view**.
209
209
210
-
If you're using an existing Azure Managed Grafana instance that already has been linked to an Azure Monitor workspace then you need the list of Grafana integrations. Copy the value of the `azureMonitorWorkspaceIntegrations` field. If it doesn't exist, then the instance hasn't been linked with any Azure Monitor workspace.
210
+
If you're using an existing Azure Managed Grafana instance that already has been linked to an Azure Monitor workspace, then you need the list of Grafana integrations. Copy the value of the `azureMonitorWorkspaceIntegrations` field. If it doesn't exist, then the instance hasn't been linked with any Azure Monitor workspace.
211
211
212
212
```json
213
213
"properties": {
@@ -230,7 +230,7 @@ If you're using an existing Azure Managed Grafana instance that already has been
230
230
2. Download the parameter file from [here](https://aka.ms/azureprometheus-enable-bicep-template-parameters) and save it as **FullAzureMonitorMetricsProfileParameters.json** in the same directory as the main bicep template.
231
231
3. Download the [nested_azuremonitormetrics_dcra_clusterResourceId.bicep](https://aka.ms/nested_azuremonitormetrics_dcra_clusterResourceId) and [nested_azuremonitormetrics_profile_clusterResourceId.bicep](https://aka.ms/nested_azuremonitormetrics_profile_clusterResourceId) files in the same directory as the main bicep template.
232
232
4. Edit the values in the parameter file.
233
-
5. The main bicep template creates all the required resources and uses 2 modules for creating the dcra and monitormetrics profile resources from the other two bicep files.
233
+
5. The main bicep template creates all the required resources and uses two modules for creating the dcra and monitormetrics profile resources from the other two bicep files.
234
234
235
235
| Parameter | Value |
236
236
|:---|:---|
@@ -239,13 +239,13 @@ If you're using an existing Azure Managed Grafana instance that already has been
239
239
| `clusterResourceId` | Resource ID for the AKS cluster. Retrieve from the **JSON view** on the **Overview** page for the cluster. |
240
240
| `clusterLocation` | Location of the AKS cluster. Retrieve from the **JSON view** on the **Overview** page for the cluster. |
241
241
| `metricLabelsAllowlist` | Comma-separated list of Kubernetes labels keys that will be used in the resource's labels metric. |
242
-
| `metricAnnotationsAllowList` | Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. |
242
+
| `metricAnnotationsAllowList` | Comma-separated list of more Kubernetes label keys that will be used in the resource's labels metric. |
243
243
| `grafanaResourceId` | Resource ID for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. |
244
244
| `grafanaLocation` | Location for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. |
245
245
| `grafanaSku` | SKU for the managed Grafana instance. Retrieve from the **JSON view** on the **Overview** page for the Grafana instance. Use the **sku.name**. |
246
246
247
247
248
-
6. Open the template file and update the `grafanaIntegrations` property at the end of the file with the values that you retrieved from the Grafana instance. This will be similar to the following:
248
+
6. Open the template file and update the `grafanaIntegrations` property at the end of the file with the values that you retrieved from the Grafana instance. This is similar to the following:
249
249
250
250
```json
251
251
{
@@ -289,10 +289,10 @@ The final `azureMonitorWorkspaceResourceId` entry is already in the template and
289
289
1. Download the main Azure policy rules template from [here](https://aka.ms/AddonPolicyMetricsProfile) and save it as **AddonPolicyMetricsProfile.rules.json**.
290
290
2. Download the parameter file from [here](https://aka.ms/AddonPolicyMetricsProfile.parameters) and save it as **AddonPolicyMetricsProfile.parameters.json** in the same directory as the rules template.
291
291
3. Create the policy definition using a command like : `az policy definition create --name "(Preview) Prometheus Metrics addon" --display-name "(Preview) Prometheus Metrics addon" --mode Indexed --metadata version=1.0.0 category=Kubernetes --rules .\AddonPolicyMetricsProfile.rules.json --params .\AddonPolicyMetricsProfile.parameters.json`
292
-
4. After creating the policy definition, go to Azure portal -> Policy -> Definitions and select the Policy definition you just created.
292
+
4. After creating the policy definition, go to Azure portal -> Policy -> Definitions and select the Policy definition you created.
293
293
5. Click on 'Assign' and then go to the 'Parameters' tab and fill in the details. Then click 'Review + Create'.
294
-
6. Now that the policy is assigned to the subscription, whenever you create a new cluster which does not have Prometheus enabled, the policy will run and deploy the resources. If you want to apply the policy to existing AKS cluster, create a 'Remediation task' for that AKS cluster resource after going to the 'Policy Assignment'.
295
-
7. Now you should see metrics flowing in the existing linked Grafana resource which is linked with the corresponding Azure Monitor Workspace.
294
+
6. Now that the policy is assigned to the subscription, whenever you create a new cluster, which does not have Prometheus enabled, the policy will run and deploy the resources. If you want to apply the policy to existing AKS cluster, create a 'Remediation task' for that AKS cluster resource after going to the 'Policy Assignment'.
295
+
7. Now you should see metrics flowing in the existing linked Grafana resource, which is linked with the corresponding Azure Monitor Workspace.
296
296
297
297
In case you create a new Managed Grafana resource from Azure portal, please link it with the corresponding Azure Monitor Workspace from the 'Linked Grafana Workspaces' tab of the relevant Azure Monitor Workspace page. Please assign the role 'Monitoring Data Reader' to the Grafana MSI on the Azure Monitor Workspace resource so that it can read data for displaying the charts, using the instructions below.
0 commit comments