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
For Windows container deployments, use images based on common [Windows base images](./container-instances-faq.yml#what-windows-base-os-images-are-supported-).
Copy file name to clipboardExpand all lines: articles/container-instances/container-instances-troubleshooting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ This error indicates that due to heavy load in the region in which you are attem
98
98
## Issues during container group runtime
99
99
### Container had an isolated restart without explicit user input
100
100
101
-
There are two broad categories for why a container group may restart without explicit user input. First, containers may experience restarts caused by an application process crash. The ACI service recommends applying observability solutions such as [Application Insights SDK](../azure-monitor/app/app-insights-overview.md), [container group metrics](container-instances-monitor.md), and [container group logs](container-instances-get-logs.md) to determine why the application experienced issues. Second, customers may experience restarts initiated by the ACI infrastructure due to maintenance events. To increase the availability of your application, run multiple container groups behind an ingress component such as an [Application Gateway](../application-gateway/overview.md) or [Traffic Manager](../traffic-manager/traffic-manager-overview.md).
101
+
There are two broad categories for why a container group may restart without explicit user input. First, containers may experience restarts caused by an application process crash. The ACI service recommends applying observability solutions such as [Application Insights SDK](../azure-monitor/app/app-insights-overview.md), [container group metrics](monitor-azure-container-instances.md#get-metrics), and [container group logs](container-instances-get-logs.md) to determine why the application experienced issues. Second, customers may experience restarts initiated by the ACI infrastructure due to maintenance events. To increase the availability of your application, run multiple container groups behind an ingress component such as an [Application Gateway](../application-gateway/overview.md) or [Traffic Manager](../traffic-manager/traffic-manager-overview.md).
102
102
103
103
### Container continually exits and restarts (no long-running process)
For a list of available metrics for Container Instances, see [Container Instances monitoring data reference](monitor-azure-container-instances-reference.md#metrics).
23
+
For a list of available metrics for Container Instances, see [Container Instances monitoring data reference](monitor-azure-container-instances-reference.md#metrics). These metrics are available for a container group and individual containers. By default, the metrics are aggregated as averages.
24
24
25
-
All metrics for Container Instances are in the namespace **Container group standard metrics**. In a container group with multiple containers, you can filter on the **containerName** dimension to acquire metrics from a specific container within the group.
25
+
All metrics for Container Instances are in the namespace **Container group standard metrics**. In a container group with multiple containers, you can filter on the **containerName** dimension to acquire metrics from a specific container within the group. Containers generate similar data as other Azure resources, but they require a containerized agent to collect required data.
26
26
27
-
Containers generate similar data as other Azure resources, but they require a containerized agent to collect required data. For more information about container metrics for Container Instances, see [Monitor container resources in Azure Container Instances](container-instances-monitor.md).
27
+
### Get metrics
28
+
29
+
You can gather Azure Monitor metrics for container instances using either the Azure portal or Azure CLI.
30
+
31
+
> [!IMPORTANT]
32
+
> Azure Monitor metrics in Azure Container Instances are currently in preview. At this time, Azure Monitor metrics are only available for Linux containers. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms). Some aspects of this feature may change prior to general availability (GA).
33
+
34
+
#### Use the Azure portal
35
+
36
+
When a container group is created, Azure Monitor data is available in the Azure portal. To see metrics for a container group, go to the **Overview** page for the container group. Here you can see pre-created charts for each of the available metrics.
37
+
38
+
:::image type="content" source="media/container-instances-monitor/metrics.png" alt-text="Screenshot of pre-created charts for available metrics.":::
39
+
40
+
In a container group that contains multiple containers, use a [dimension](../azure-monitor/essentials/data-platform-metrics.md#multi-dimensional-metrics) to display metrics by container. To create a chart with individual container metrics, perform the following steps:
41
+
42
+
1. In the **Overview** page, select one of the metric charts, such as **CPU**.
43
+
1. Select the **Apply splitting** button, and select **Container Name**.
44
+
45
+
:::image type="content" source="media/container-instances-monitor/dimension.png" alt-text="Screenshot that shows the metrics for a container instance with Apply splitting selected and Container Name selected.":::
46
+
47
+
#### Use Azure CLI
48
+
49
+
Metrics for container instances can also be gathered using the Azure CLI. First, get the ID of the container group using the following command. Replace `<resource-group>` with your resource group name and `<container-group>` with the name of your container group.
50
+
51
+
```azurecli
52
+
CONTAINER_GROUP=$(az container show --resource-group <resource-group> --name <container-group> --query id --output tsv)
53
+
```
54
+
55
+
Use the following command to get **CPU** usage metrics.
56
+
57
+
```azurecli
58
+
az monitor metrics list --resource $CONTAINER_GROUP --metric CPUUsage --output table
59
+
```
60
+
61
+
```output
62
+
Timestamp Name Average
63
+
------------------- --------- ---------
64
+
2020-12-17 23:34:00 CPU Usage
65
+
. . .
66
+
2020-12-18 00:25:00 CPU Usage
67
+
2020-12-18 00:26:00 CPU Usage 0.4
68
+
2020-12-18 00:27:00 CPU Usage 0.0
69
+
```
70
+
71
+
Change the value of the `--metric` parameter in the command to get other [supported metrics](monitor-azure-container-instances-reference.md#metrics). For example, use the following command to get **memory** usage metrics.
72
+
73
+
```azurecli
74
+
az monitor metrics list --resource $CONTAINER_GROUP --metric MemoryUsage --output table
75
+
```
76
+
77
+
```output
78
+
Timestamp Name Average
79
+
------------------- ------------ ----------
80
+
2019-04-23 22:59:00 Memory Usage
81
+
2019-04-23 23:00:00 Memory Usage
82
+
2019-04-23 23:01:00 Memory Usage 0.0
83
+
2019-04-23 23:02:00 Memory Usage 8859648.0
84
+
2019-04-23 23:03:00 Memory Usage 9181184.0
85
+
2019-04-23 23:04:00 Memory Usage 9580544.0
86
+
2019-04-23 23:05:00 Memory Usage 10280960.0
87
+
2019-04-23 23:06:00 Memory Usage 7815168.0
88
+
2019-04-23 23:07:00 Memory Usage 7739392.0
89
+
2019-04-23 23:08:00 Memory Usage 8212480.0
90
+
2019-04-23 23:09:00 Memory Usage 8159232.0
91
+
2019-04-23 23:10:00 Memory Usage 8093696.0
92
+
```
93
+
94
+
For a multi-container group, the `containerName` dimension can be added to return metrics per container.
95
+
96
+
```azurecli
97
+
az monitor metrics list --resource $CONTAINER_GROUP --metric MemoryUsage --dimension containerName --output table
0 commit comments