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/containers/container-insights-custom-metrics.md
+43-45Lines changed: 43 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,100 +8,100 @@ ms.reviewer: viviandiec
8
8
---
9
9
10
10
# Metrics collected by Container insights
11
-
Container insights collects [custom metrics](../essentials/metrics-custom-overview.md) from Azure Kubernetes Service (AKS) and Azure Arc-enabled Kubernetes cluster nodes and pods, which allows you to present timely aggregate calculations (average, count, maximum, minimum, sum) in performance charts, pin performance charts in Azure portal dashboards, and take advantage of [metric alerts](../alerts/alerts-types.md#metric-alerts).
11
+
Container insights collects [custom metrics](../essentials/metrics-custom-overview.md) from Azure Kubernetes Service (AKS) and Azure Arc-enabled Kubernetes cluster nodes and pods. With custom metrics, you can:
12
+
13
+
- Present timely aggregate calculations (average, count, maximum, minimum, and sum) in performance charts.
14
+
- Pin performance charts in Azure portal dashboards.
15
+
- Take advantage of [metric alerts](../alerts/alerts-types.md#metric-alerts).
12
16
13
17
> [!NOTE]
14
18
> This article describes collection of custom metrics from Kubernetes clusters. You can also collect Prometheus metrics as described in [Collect Prometheus metrics with Container insights](container-insights-prometheus.md).
15
19
16
-
## Using custom metrics
20
+
## Use custom metrics
17
21
Custom metrics collected by Container insights can be accessed with the same methods as custom metrics collected from other data sources, including [metrics explorer](../essentials/metrics-getting-started.md) and [metrics alerts](../alerts/alerts-types.md#metric-alerts).
18
22
19
23
## Metrics collected
20
24
The following sections describe the metric values collected for your cluster.
21
25
22
26
### Node metrics
23
27
24
-
Namespace: `Insights.container/nodes`<br>
25
-
Dimensions: `host`
26
-
28
+
**Namespace:**`Insights.container/nodes`<br>
29
+
**Dimensions:**`host`
27
30
28
31
|Metric |Description |
29
32
|----|------------|
30
33
|cpuUsageMillicores |CPU utilization in millicores by host.|
31
-
|cpuUsagePercentage, cpuUsageAllocatablePercentage (preview) |CPU usage percentage by node and allocatable respectively.|
34
+
|cpuUsagePercentage, cpuUsageAllocatablePercentage (preview) |CPU usage percentage by node and allocatable, respectively.|
32
35
|memoryRssBytes |Memory RSS utilization in bytes by host.|
33
-
|memoryRssPercentage, memoryRssAllocatablePercentage (preview) |Memory RSS usage percentage by host and allocatable respectively.|
36
+
|memoryRssPercentage, memoryRssAllocatablePercentage (preview) |Memory RSS usage percentage by host and allocatable, respectively.|
34
37
|memoryWorkingSetBytes |Memory Working Set utilization in bytes by host.|
35
-
|memoryWorkingSetPercentage, memoryRssAllocatablePercentage (preview) |Memory Working Set usage percentage by host and allocatable respectively.|
38
+
|memoryWorkingSetPercentage, memoryRssAllocatablePercentage (preview) |Memory Working Set usage percentage by host and allocatable, respectively.|
36
39
|nodesCount |Count of nodes by status.|
37
40
|diskUsedPercentage |Percentage of disk used on the node by device.|
|**(Old)cpuExceededPercentage**|CPU utilization percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.<br> Collected |
58
-
|**(New)cpuThresholdViolated**|Metric triggered when CPU utilization percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.<br> Collected |
59
-
|**(Old)memoryRssExceededPercentage**|Memory RSS percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.|
60
-
|**(New)memoryRssThresholdViolated**|Metric triggered when Memory RSS percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.|
61
-
|**(Old)memoryWorkingSetExceededPercentage**|Memory Working Set percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.|
62
-
|**(New)memoryWorkingSetThresholdViolated**|Metric triggered when Memory Working Set percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, pod name.|
63
-
60
+
|(Old)cpuExceededPercentage |CPU utilization percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.<br> Collected |
61
+
|(New)cpuThresholdViolated |Metric triggered when CPU utilization percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.<br> Collected |
62
+
|(Old)memoryRssExceededPercentage |Memory RSS percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.|
63
+
|(New)memoryRssThresholdViolated |Metric triggered when Memory RSS percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.|
64
+
|(Old)memoryWorkingSetExceededPercentage |Memory Working Set percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.|
65
+
|(New)memoryWorkingSetThresholdViolated |Metric triggered when Memory Working Set percentage for containers exceeding user configurable threshold (default is 95.0) by container name, controller name, Kubernetes namespace, and pod name.|
|**(Old)pvUsageExceededPercentage**|PV utilization percentage for persistent volumes exceeding user configurable threshold (default is 60.0) by claim name, Kubernetes namespace, volume name, pod name, and node name.|
74
-
|**(New)pvUsageThresholdViolated**|Metric triggered when PV utilization percentage for persistent volumes exceeding user configurable threshold (default is 60.0) by claim name, Kubernetes namespace, volume name, pod name, and node name.|
74
+
|(Old)pvUsageExceededPercentage|Persistent volume (PV) utilization percentage for persistent volumes exceeding user configurable threshold (default is 60.0) by claim name, Kubernetes namespace, volume name, pod name, and node name.|
75
+
|(New)pvUsageThresholdViolated |Metric triggered when PV utilization percentage for persistent volumes exceeding user configurable threshold (default is 60.0) by claim name, Kubernetes namespace, volume name, pod name, and node name.|
75
76
76
77
## Enable custom metrics
77
-
If your cluster uses [managed identity authentication](container-insights-onboard.md#authentication) for Container insights, then custom metrics will be enabled for you. If not, then you need to enable custom metrics using one of the methods described below.
78
+
If your cluster uses [managed identity authentication](container-insights-onboard.md#authentication) for Container insights, custom metrics will be enabled for you. If not, you need to enable custom metrics by using one of the following methods.
78
79
79
80
This process assigns the *Monitoring Metrics Publisher* role to the cluster's service principal. Monitoring Metrics Publisher has permission only to push metrics to the resource. It can't alter any state, update the resource, or read any data. For more information, see [Monitoring Metrics Publisher role](../../role-based-access-control/built-in-roles.md#monitoring-metrics-publisher). The Monitoring Metrics Publisher role requirement doesn't apply to Azure Arc-enabled Kubernetes clusters.
80
81
81
82
### Prerequisites
82
83
83
-
Before you update your cluster, confirm the following:
84
+
Before you update your cluster:
84
85
85
86
- See the supported regions for custom metrics at [Supported regions](../essentials/metrics-custom-overview.md#supported-regions).
86
-
87
-
* You're a member of the [Owner](../../role-based-access-control/built-in-roles.md#owner) role on the AKS cluster resource to enable collection of custom performance metrics for nodes and pods. This requirement does not apply to Azure Arc-enabled Kubernetes clusters.
87
+
- Confirm that you're a member of the [Owner](../../role-based-access-control/built-in-roles.md#owner) role on the AKS cluster resource to enable collection of custom performance metrics for nodes and pods. This requirement doesn't apply to Azure Arc-enabled Kubernetes clusters.
88
88
89
89
### Enablement options
90
90
Use one of the following methods to enable custom metrics for either a single cluster or all clusters in your subscription.
91
91
92
92
#### [Azure portal](#tab/portal)
93
93
94
94
1. Select the **Insights** menu for the cluster in the Azure portal.
95
-
2. In the banner that appears at the top of the pane, select **Enable** to start the update.
95
+
1. On the banner that appears at the top of the pane, select **Enable** to start the update.
96
96
97
-
:::image type="content" source="./media/container-insights-update-metrics/portal-banner-enable-01.png" alt-text="Screenshot of the Azure portal that shows the banner for upgrading an AKS cluster." lightbox="media/container-insights-update-metrics/portal-banner-enable-01.png":::
97
+
:::image type="content" source="./media/container-insights-update-metrics/portal-banner-enable-01.png" alt-text="Screenshot that shows the Azure portal with the banner for upgrading an AKS cluster." lightbox="media/container-insights-update-metrics/portal-banner-enable-01.png":::
98
98
99
99
The process can take several seconds to finish. You can track its progress under **Notifications** from the menu.
100
100
101
101
### [CLI](#tab/cli)
102
102
103
103
#### Update a single cluster
104
-
In the command below, edit the values for `subscriptionId`, `resourceGroupName`, and `clusterName` by using the values on the **AKS Overview** page for the AKS cluster. The value of `clientIdOfSPN` is returned when you run the command `az aks show`.
104
+
In the following command, edit the values for `subscriptionId`, `resourceGroupName`, and `clusterName` by using the values on the **AKS Overview** page for the AKS cluster. The value of `clientIdOfSPN` is returned when you run the command `az aks show`.
105
105
106
106
```azurecli
107
107
az login
@@ -111,7 +111,7 @@ az aks show -g <resourceGroupName> -n <clusterName> --query "addonProfiles.omsag
111
111
az role assignment create --assignee <clientIdOfSPN> --scope <clusterResourceId> --role "Monitoring Metrics Publisher"
112
112
```
113
113
114
-
To get the value for `clientIdOfSPNOrMsi`, you can run the command `az aks show` as shown in the following example. If the `servicePrincipalProfile` object has a valid `objectid` value, you can use that. Otherwise, if it's set to `msi`, you need to pass in the Object ID from `addonProfiles.omsagent.identity.objectId`.
114
+
To get the value for `clientIdOfSPNOrMsi`, run the command `az aks show` as shown in the following example. If the `servicePrincipalProfile` object has a valid `objectid` value, you can use that. Otherwise, if it's set to `msi`, pass in the object ID from `addonProfiles.omsagent.identity.objectId`.
115
115
116
116
```azurecli
117
117
az login
@@ -125,30 +125,29 @@ az role assignment create --assignee <clientIdOfSPNOrMsi> --scope <clusterResour
125
125
>If you want to perform the role assignment with your user account, use the `--assignee` parameter as shown in the example. If you want to perform the role assignment with a service principal name (SPN), use the `--assignee-object-id` and `--assignee-principal-type` parameters instead of the `--assignee` parameter.
126
126
127
127
#### Update all clusters
128
-
Run the following command to update all clusters in your subscription. Edit the value for `subscriptionId` by using the value from the **AKS Overview** page for the AKS cluster.
128
+
Run the following command to update all clusters in your subscription. Edit the value for `subscriptionId` by using the value on the **AKS Overview** page for the AKS cluster.
The configuration change can take a few seconds to finish. When it's finished, a message like the following one appears and includes the result:
136
137
137
138
```azurecli
138
139
completed role assignments for all AKS clusters in subscription: <subscriptionId>
139
140
```
140
141
141
-
142
-
143
142
### [PowerShell](#tab/powershell)
144
143
145
144
#### Update a single cluster
146
145
147
-
Use the following steps to enable custom metrics for a specific cluster.
146
+
To enable custom metrics for a specific cluster:
148
147
149
148
1.[Download the *mdm_onboarding.ps1* script from GitHub](https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/docs/aks/mdmonboarding/mdm_onboarding.ps1) and save it to a local folder.
150
149
151
-
2. Run the following command. Edit the values for `subscriptionId`, `resourceGroupName`, and `clusterName` by using the values on the **AKS Overview** page for the AKS cluster.
150
+
1. Run the following command. Edit the values for `subscriptionId`, `resourceGroupName`, and `clusterName` by using the values on the **AKS Overview** page for the AKS cluster.
@@ -160,13 +159,12 @@ Use the following steps to enable custom metrics for a specific cluster.
160
159
Successfully added Monitoring Metrics Publisher role assignment to cluster : <clusterName>
161
160
```
162
161
163
-
164
162
#### Update all clusters
165
163
166
-
Use the following steps to enable custom metrics for all clusters in your subscription.
164
+
To enable custom metrics for all clusters in your subscription:
167
165
168
166
1. [Download the *mdm_onboarding_atscale.ps1* script from GitHub](https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/docs/aks/mdmonboarding/mdm_onboarding_atscale.ps1) and save it to a local folder.
169
-
2. Run the following command. Edit the value for `subscriptionId` by using the value from the **AKS Overview** page for the AKS cluster.
167
+
1. Run the following command. Edit the value for `subscriptionId` by using the value on the **AKS Overview** page for the AKS cluster.
170
168
171
169
```powershell
172
170
.\mdm_onboarding_atscale.ps1 subscriptionId
@@ -180,9 +178,9 @@ Use the following steps to enable custom metrics for all clusters in your subscr
180
178
---
181
179
182
180
## Verify the update
183
-
You can verify that custom metrics is enabled by opening [metrics explorer](../essentials/metrics-getting-started.md) and verify from **Metric namespace** that **insights** is listed.
181
+
To verify that custom metrics are enabled, open [metrics explorer](../essentials/metrics-getting-started.md) and verify from **Metric namespace** that **insights** is listed.
184
182
185
183
## Next steps
186
184
187
-
- [Create alerts based on custom metrics collected for the cluster](container-insights-metric-alerts.md).
185
+
- [Create alerts based on custom metrics collected for the cluster](container-insights-metric-alerts.md)
188
186
- [Collect Prometheus metrics from your AKS cluster](container-insights-prometheus.md)
0 commit comments