Skip to content

Commit a550f6d

Browse files
authored
Merge pull request #100594 from MGoedtel/Task1661768b
Include support for ARO metric scraping
2 parents 25a493b + c8f47e4 commit a550f6d

File tree

4 files changed

+142
-39
lines changed

4 files changed

+142
-39
lines changed

articles/azure-monitor/insights/container-insights-agent-config.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
title: Configure Azure Monitor for containers agent data collection | Microsoft Docs
33
description: This article describes how you can configure the Azure Monitor for containers agent to control stdout/stderr and environment variables log collection.
44
ms.topic: conceptual
5-
ms.date: 10/15/2019
5+
ms.date: 01/13/2020
66
---
77

88
# Configure agent data collection for Azure Monitor for containers
99

10-
Azure Monitor for containers collects stdout, stderr, and environmental variables from container workloads deployed to managed Kubernetes clusters hosted on Azure Kubernetes Service (AKS) from the containerized agent. You can configure agent data collection settings by creating a custom Kubernetes ConfigMaps to control this experience.
10+
Azure Monitor for containers collects stdout, stderr, and environmental variables from container workloads deployed to managed Kubernetes clusters from the containerized agent. You can configure agent data collection settings by creating a custom Kubernetes ConfigMaps to control this experience.
1111

1212
This article demonstrates how to create ConfigMap and configure data collection based on your requirements.
1313

14+
>[!NOTE]
15+
>For Azure Red Hat OpenShift, a template ConfigMap file is created in the *openshift-azure-logging* namespace.
16+
>
17+
1418
## ConfigMap file settings overview
1519

1620
A template ConfigMap file is provided that allows you to easily edit it with your customizations without having to create it from scratch. Before starting, you should review the Kubernetes documentation about [ConfigMaps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) and familiarize yourself with how to create, configure, and deploy ConfigMaps. This will allow you to filter stderr and stdout per namespace or across the entire cluster, and environment variables for any container running across all pods/nodes in the cluster.
@@ -39,25 +43,30 @@ ConfigMaps is a global list and there can be only one ConfigMap applied to the a
3943

4044
Perform the following steps to configure and deploy your ConfigMap configuration file to your cluster.
4145

42-
1. [Download](https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/Kubernetes/container-azm-ms-agentconfig.yaml) the template ConfigMap yaml file and save it as container-azm-ms-agentconfig.yaml.
46+
1. [Download](https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/Kubernetes/container-azm-ms-agentconfig.yaml) the template ConfigMap yaml file and save it as container-azm-ms-agentconfig.yaml.
47+
48+
>[!NOTE]
49+
>This step is not required when working with Azure Red Hat OpenShift since the ConfigMap template already exists on the cluster.
4350
44-
2. Edit the ConfigMap yaml file with your customizations to collect stdout, stderr, and/or environmental variables.
51+
2. Edit the ConfigMap yaml file with your customizations to collect stdout, stderr, and/or environmental variables. If you are editing the ConfigMap yaml file for Azure Red Hat OpenShift, first run the command `oc edit configmaps container-azm-ms-agentconfig -n openshift-azure-logging` to open the file in a text editor.
4552

4653
- To exclude specific namespaces for stdout log collection, you configure the key/value using the following example: `[log_collection_settings.stdout] enabled = true exclude_namespaces = ["my-namespace-1", "my-namespace-2"]`.
4754

4855
- To disable environment variable collection for a specific container, set the key/value `[log_collection_settings.env_var] enabled = true` to enable variable collection globally, and then follow the steps [here](container-insights-manage-agent.md#how-to-disable-environment-variable-collection-on-a-container) to complete configuration for the specific container.
4956

5057
- To disable stderr log collection cluster-wide, you configure the key/value using the following example: `[log_collection_settings.stderr] enabled = false`.
5158

52-
3. Create ConfigMap by running the following kubectl command: `kubectl apply -f <configmap_yaml_file.yaml>`.
59+
3. For clusters other than Azure Red Hat OpenShift, create ConfigMap by running the following kubectl command: `kubectl apply -f <configmap_yaml_file.yaml>` on clusters other than Azure Red Hat OpenShift.
5360

5461
Example: `kubectl apply -f container-azm-ms-agentconfig.yaml`.
55-
56-
The configuration change can take a few minutes to finish before taking effect, and all omsagent pods in the cluster will restart. The restart is a rolling restart for all omsagent pods, not all restart at the same time. When the restarts are finished, a message is displayed that's similar to the following and includes the result: `configmap "container-azm-ms-agentconfig" created`.
5762

58-
## Verify configuration
63+
For Azure Red Hat OpenShift, save your changes in the editor.
5964

60-
To verify the configuration was successfully applied, use the following command to review the logs from an agent pod: `kubectl logs omsagent-fdf58 -n=kube-system`. If there are configuration errors from the omsagent pods, the output will show errors similar to the following:
65+
The configuration change can take a few minutes to finish before taking effect, and all omsagent pods in the cluster will restart. The restart is a rolling restart for all omsagent pods, not all restart at the same time. When the restarts are finished, a message is displayed that's similar to the following and includes the result: `configmap "container-azm-ms-agentconfig" created`.
66+
67+
## Verify configuration
68+
69+
To verify the configuration was successfully applied to a cluster other than Azure Red Hat OpenShift, use the following command to review the logs from an agent pod: `kubectl logs omsagent-fdf58 -n=kube-system`. If there are configuration errors from the omsagent pods, the output will show errors similar to the following:
6170

6271
```
6372
***************Start Config Processing********************
@@ -68,6 +77,10 @@ Errors related to applying configuration changes are also available for review.
6877

6978
- From an agent pod logs using the same `kubectl logs` command.
7079

80+
>[!NOTE]
81+
>This command is not applicable to Azure Red Hat OpenShift cluster.
82+
>
83+
7184
- From Live logs. Live logs show errors similar to the following:
7285

7386
```
@@ -76,11 +89,21 @@ Errors related to applying configuration changes are also available for review.
7689
7790
- From the **KubeMonAgentEvents** table in your Log Analytics workspace. Data is sent every hour with *Error* severity for configuration errors. If there are no errors, the entry in the table will have data with severity *Info*, which reports no errors. The **Tags** property contains more information about the pod and container ID on which the error occurred and also the first occurrence, last occurrence and count in the last hour.
7891
79-
Errors prevent omsagent from parsing the file, causing it to restart and use the default configuration. After you correct the error(s) in ConfigMap, save the yaml file and apply the updated ConfigMaps by running the command: `kubectl apply -f <configmap_yaml_file.yaml`.
92+
- With Azure Red Hat OpenShift, check the omsagent logs by searching the **ContainerLog** table to verify if log collection of openshift-azure-logging is enabled.
93+
94+
After you correct the error(s) in ConfigMap on clusters other than Azure Red Hat OpenShift, save the yaml file and apply the updated ConfigMaps by running the command: `kubectl apply -f <configmap_yaml_file.yaml`. For Azure Red Hat OpenShift, edit and save the updated ConfigMaps by running the command:
95+
96+
``` bash
97+
oc edit configmaps container-azm-ms-agentconfig -n openshift-azure-logging
98+
```
8099

81100
## Applying updated ConfigMap
82101

83-
If you have already deployed a ConfigMap to your cluster and you want to update it with a newer configuration, you can edit the ConfigMap file you've previously used and then apply using the same command as before, `kubectl apply -f <configmap_yaml_file.yaml`.
102+
If you have already deployed a ConfigMap on clusters other than Azure Red Hat OpenShift and you want to update it with a newer configuration, you can edit the ConfigMap file you've previously used and then apply using the same command as before, `kubectl apply -f <configmap_yaml_file.yaml`. For Azure Red Hat OpenShift, edit and save the updated ConfigMaps by running the command:
103+
104+
``` bash
105+
oc edit configmaps container-azm-ms-agentconfig -n openshift-azure-logging
106+
```
84107

85108
The configuration change can take a few minutes to finish before taking effect, and all omsagent pods in the cluster will restart. The restart is a rolling restart for all omsagent pods, not all restart at the same time. When the restarts are finished, a message is displayed that's similar to the following and includes the result: `configmap "container-azm-ms-agentconfig" updated`.
86109

articles/azure-monitor/insights/container-insights-azure-redhat-setup.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Configure Azure Red Hat OpenShift clusters with Azure Monitor for containers | Microsoft Docs
3-
description: This article describes how you can configure Azure Monitor for containers to monitor Kubernetes clusters hosted on Azure Red Hat OpenShift.
3+
description: This article describes how to configure monitoring of a Kubernetes cluster with Azure Monitor hosted on Azure Red Hat OpenShift.
44
ms.topic: conceptual
5-
ms.date: 11/21/2019
5+
ms.date: 01/13/2020
66
---
77

88
# Configure Azure Red Hat OpenShift clusters with Azure Monitor for containers
@@ -22,10 +22,8 @@ Azure Monitor for containers can be enabled for new, or one or more existing dep
2222

2323
Azure Monitor for containers supports monitoring Azure Red Hat OpenShift as described in the [Overview](container-insights-overview.md) article, except for the following features:
2424

25-
- Live data
26-
- Prometheus metrics scraping
25+
- Live Data (preview)
2726
- [Collect metrics](container-insights-update-metrics.md) from cluster nodes and pods and storing them in the Azure Monitor metrics database
28-
- Health feature
2927

3028
## Prerequisites
3129

articles/azure-monitor/insights/container-insights-manage-agent.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
title: How to manage the Azure Monitor for containers agent | Microsoft Docs
33
description: This article describes managing the most common maintenance tasks with the containerized Log Analytics agent used by Azure Monitor for containers.
44
ms.topic: conceptual
5-
ms.date: 12/06/2018
5+
ms.date: 01/13/2020
66

77
---
88

99
# How to manage the Azure Monitor for containers agent
10+
1011
Azure Monitor for containers uses a containerized version of the Log Analytics agent for Linux. After initial deployment, there are routine or optional tasks you may need to perform during its lifecycle. This article details on how to manually upgrade the agent and disable collection of environmental variables from a particular container.
1112

1213
## How to upgrade the Azure Monitor for containers agent
14+
1315
Azure Monitor for containers uses a containerized version of the Log Analytics agent for Linux. When a new version of the agent is released, the agent is automatically upgraded on your managed Kubernetes clusters hosted on Azure Kubernetes Service (AKS).
1416

1517
If the agent upgrade fails, this article describes the process to manually upgrade the agent. To follow the versions released, see [agent release announcements](https://github.com/microsoft/docker-provider/tree/ci_feature_prod).
1618

1719
### Upgrading agent on monitored Kubernetes cluster
18-
The process to upgrade the agent consists of two straight forward steps. The first step is to disable monitoring with Azure Monitor for containers using Azure CLI. Follow the steps described in the [Disable monitoring](container-insights-optout.md?#azure-cli) article. Using Azure CLI allows us to remove the agent from the nodes in the cluster without impacting the solution and the corresponding data that is stored in the workspace.
20+
21+
The process to upgrade the agent on clusters, other than Azure Red Hat OpenShift, consists of two straight forward steps. The first step is to disable monitoring with Azure Monitor for containers using Azure CLI. Follow the steps described in the [Disable monitoring](container-insights-optout.md?#azure-cli) article. Using Azure CLI allows us to remove the agent from the nodes in the cluster without impacting the solution and the corresponding data that is stored in the workspace.
1922

2023
>[!NOTE]
2124
>While you are performing this maintenance activity, the nodes in the cluster are not forwarding collected data, and performance views will not show data between the time you remove the agent and install the new version.
2225
>
2326
2427
To install the new version of the agent, follow the steps described in the [enable monitoring using Azure CLI](container-insights-enable-new-cluster.md#enable-using-azure-cli), to complete this process.
2528

26-
After you've re-enabled monitoring, it might take about 15 minutes before you can view updated health metrics for the cluster. To verify the agent upgraded successfully, run the command: `kubectl logs omsagent-484hw --namespace=kube-system`
29+
After you've re-enabled monitoring, it might take about 15 minutes before you can view updated health metrics for the cluster. To verify the agent upgraded successfully, run the command: `kubectl logs omsagent-484hw --namespace=kube-system`
2730

2831
The status should resemble the following example, where the value for *omi* and *omsagent* should match the latest version specified in the [agent release history](https://github.com/microsoft/docker-provider/tree/ci_feature_prod).
2932

@@ -47,18 +50,25 @@ The status should resemble the following example, where the value for *omi* and
4750
docker-cimprov 1.0.0.31
4851

4952
## How to disable environment variable collection on a container
50-
Azure Monitor for containers collects environmental variables from the containers running in a pod and presents them in the property pane of the selected container in the **Containers** view. You can control this behavior by disabling collection for a specific container either during deployment of the AKS cluster, or after by setting the environment variable *AZMON_COLLECT_ENV*. This feature is available from the agent version – ciprod11292018 and higher.
5153

52-
To disable collection of environmental variables on a new or existing container, set the variable **AZMON_COLLECT_ENV** with a value of **False** in your Kubernetes deployment yaml configuration file.
54+
Azure Monitor for containers collects environmental variables from the containers running in a pod and presents them in the property pane of the selected container in the **Containers** view. You can control this behavior by disabling collection for a specific container either during deployment of the Kubernetes cluster, or after by setting the environment variable *AZMON_COLLECT_ENV*. This feature is available from the agent version – ciprod11292018 and higher.
55+
56+
To disable collection of environmental variables on a new or existing container, set the variable **AZMON_COLLECT_ENV** with a value of **False** in your Kubernetes deployment yaml configuration file.
5357

5458
```
5559
- name: AZMON_COLLECT_ENV
5660
value: "False"
5761
```
5862

59-
Run the following command to apply the change to your AKS container: `kubectl apply -f <path to yaml file>`.
63+
Run the following command to apply the change to Kubernetes clusters other than Azure Red Hat OpenShift): `kubectl apply -f <path to yaml file>`. To edit ConfigMap and apply this change for Azure Red Hat OpenShift clusters, run the command:
6064

61-
To verify the configuration change took effect, select a container in the **Containers** view in Azure Monitor for containers, and in the property panel, expand **Environment Variables**. The section should show only the variable created earlier - **AZMON_COLLECT_ENV=FALSE**. For all other containers, the Environment Variables section should list all the environment variables discovered.
65+
``` bash
66+
oc edit configmaps container-azm-ms-agentconfig -n openshift-azure-logging
67+
```
68+
69+
This opens your default text editor. After setting the variable, save the file in the editor.
70+
71+
To verify the configuration change took effect, select a container in the **Containers** view in Azure Monitor for containers, and in the property panel, expand **Environment Variables**. The section should show only the variable created earlier - **AZMON_COLLECT_ENV=FALSE**. For all other containers, the Environment Variables section should list all the environment variables discovered.
6272

6373
To re-enable discovery of the environmental variables, apply the same process earlier and change the value from **False** to **True**, and then rerun the `kubectl` command to update the container.
6474

@@ -68,4 +78,5 @@ To re-enable discovery of the environmental variables, apply the same process ea
6878
```
6979

7080
## Next steps
81+
7182
If you experience issues while upgrading the agent, review the [troubleshooting guide](container-insights-troubleshoot.md) for support.

0 commit comments

Comments
 (0)