diff --git a/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf b/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf index 79c7bf941..e9f94cd45 100644 --- a/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf +++ b/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf @@ -64,7 +64,6 @@ [[inputs.procstat]] name_prefix = "t.azm.ms/" - exe = "ruby" interval = "60s" pid_finder = "native" pid_tag = true @@ -76,6 +75,9 @@ AgentVersion = "$AGENT_VERSION" ControllerType = "$CONTROLLER_TYPE" AksResourceId = "$AKS_RESOURCE_ID" + [[inputs.procstat.filter]] + name = "fluentd" + process_names = ["fluentd"] [[inputs.procstat]] name_prefix = "t.azm.ms/" @@ -109,7 +111,6 @@ [[inputs.procstat]] name_prefix = "t.azm.ms/" - pattern = "fluentd" interval = "60s" pid_finder = "native" pid_tag = true @@ -121,6 +122,9 @@ AgentVersion = "$AGENT_VERSION" ControllerType = "$CONTROLLER_TYPE" AksResourceId = "$AKS_RESOURCE_ID" + [[inputs.procstat.filter]] + name = "ruby" + process_names = ["ruby"] [[inputs.procstat]] name_prefix = "t.azm.ms/" diff --git a/build/windows/installer/conf/procstat-telegraf.conf b/build/windows/installer/conf/procstat-telegraf.conf new file mode 100644 index 000000000..e69de29bb diff --git a/charts/azuremonitor-containerinsights-for-prod-clusters/files/setup-procstat.sh b/charts/azuremonitor-containerinsights-for-prod-clusters/files/setup-procstat.sh new file mode 100644 index 000000000..e69de29bb diff --git a/charts/azuremonitor-containerinsights-for-prod-clusters/templates/ama-logs.yaml b/charts/azuremonitor-containerinsights-for-prod-clusters/templates/ama-logs.yaml index 0e806e47e..c4efb78d3 100644 --- a/charts/azuremonitor-containerinsights-for-prod-clusters/templates/ama-logs.yaml +++ b/charts/azuremonitor-containerinsights-for-prod-clusters/templates/ama-logs.yaml @@ -718,6 +718,12 @@ spec: - mountPath: /etc/config/settings/adx name: ama-logs-adx-secret readOnly: true + - mountPath: /opt/main.sh + name: procstat-override + subPath: main.sh + - mountPath: /etc/opt/microsoft/docker-cimprov/telegraf-ama-logs-process-metrics.conf + name: procstat-override + subPath: telegraf-ama-logs-process-metrics.conf {{- if (eq (include "should_mount_hostca" $ ) "true" ) }} # USSec and USNat have cloud-specific Root and Intermediate CAs that must be mounted into all running containers from the host # Container Insights has logic to update the trust store in the image based on certs present in /anchors/ mounts below @@ -859,6 +865,12 @@ spec: - mountPath: /var/run/mdsd-ci name: mdsd-sock {{- end }} + - mountPath: /opt/main.sh + name: procstat-override + subPath: main.sh + - mountPath: /etc/opt/microsoft/docker-cimprov/telegraf-ama-logs-process-metrics.conf + name: procstat-override + subPath: telegraf-ama-logs-process-metrics.conf livenessProbe: exec: command: @@ -970,6 +982,11 @@ spec: configMap: name: container-azm-ms-osmconfig optional: true + - name: procstat-override + configMap: + name: procstat-override-linux + defaultMode: 0755 + optional: true {{- if (eq (include "should_mount_hostca" $ ) "true" ) }} - name: anchors-ubuntu hostPath: @@ -1245,6 +1262,12 @@ spec: - mountPath: /etc/config/osm-settings name: osm-settings-vol-config readOnly: true + - mountPath: /opt/main.sh + name: procstat-override + subPath: main.sh + - mountPath: /etc/opt/microsoft/docker-cimprov/telegraf-ama-logs-process-metrics.conf + name: procstat-override + subPath: telegraf-ama-logs-process-metrics.conf {{- if (eq (include "should_mount_hostca" . ) "true" ) }} # USSec and USNat have cloud-specific Root and Intermediate CAs that must be mounted into all running containers from the host # Container Insights has logic to update the trust store in the image based on certs present in /anchors/ mounts below @@ -1332,6 +1355,11 @@ spec: configMap: name: container-azm-ms-osmconfig optional: true + - name: procstat-override + configMap: + name: procstat-override-linux + defaultMode: 0755 + optional: true {{- if (eq (include "should_mount_hostca" . ) "true" ) }} - name: anchors-ubuntu hostPath: diff --git a/kubernetes/linux/main.sh b/kubernetes/linux/main.sh index 14553e4b6..9261f706f 100644 --- a/kubernetes/linux/main.sh +++ b/kubernetes/linux/main.sh @@ -1408,24 +1408,26 @@ fi #start a telegraf instance for collecting process metrics inside ama-logs containers (if enabled via ConfigMap) if [ "${AZMON_COLLECT_AMA_LOGS_PROCESS_METRICS}" == "true" ]; then amaLogsProcessMetricsConfFile="/etc/opt/microsoft/docker-cimprov/telegraf-ama-logs-process-metrics.conf" + amaLogsProcessMetricsConfRuntime="/opt/telegraf-ama-logs-process-metrics.conf" if [ -e "$amaLogsProcessMetricsConfFile" ]; then echo "start a telegraf instance for collecting process metrics inside ama-logs containers" + cp "$amaLogsProcessMetricsConfFile" "$amaLogsProcessMetricsConfRuntime" nodename=$(cat /var/opt/microsoft/docker-cimprov/state/containerhostname) podname=$(hostname) - sed -i -e "s/placeholder_hostname/$nodename/g" $amaLogsProcessMetricsConfFile - sed -i -e "s/placeholder_podname/$podname/g" $amaLogsProcessMetricsConfFile + sed -i -e "s/placeholder_hostname/$nodename/g" $amaLogsProcessMetricsConfRuntime + sed -i -e "s/placeholder_podname/$podname/g" $amaLogsProcessMetricsConfRuntime # Set ControllerType for PrometheusSidecar if [ "${CONTAINER_TYPE}" == "PrometheusSidecar" ]; then - sed -i -e 's/\$CONTROLLER_TYPE/PrometheusSidecar/g' $amaLogsProcessMetricsConfFile + sed -i -e 's/\$CONTROLLER_TYPE/PrometheusSidecar/g' $amaLogsProcessMetricsConfRuntime fi # Set App Insights instrumentation key (Base64 decode) if [ -n "$APPLICATIONINSIGHTS_AUTH" ] && [ -n "$AKS_RESOURCE_ID" ]; then appinsightsKey=$(echo "$APPLICATIONINSIGHTS_AUTH" | base64 -d | tr -d '\n') - sed -i -e "s/placeholder_appinsights_key/$appinsightsKey/g" $amaLogsProcessMetricsConfFile + sed -i -e "s/placeholder_appinsights_key/$appinsightsKey/g" $amaLogsProcessMetricsConfRuntime # Use /proc so telegraf only collect process metrics inside ama-logs containers. - HOST_PROC=/proc /opt/telegraf --non-strict-env-handling --config $amaLogsProcessMetricsConfFile & + HOST_PROC=/proc /opt/telegraf --non-strict-env-handling --config $amaLogsProcessMetricsConfRuntime & else - echo "APPLICATIONINSIGHTS_AUTH or AKS_RESOURCE_ID not set, skipping ama-logs process metrics monitoring" + echo "APPLICATIONINSIGHTS_AUTH or AKS_RESOURCE_ID not set, skipping process metrics telegraf" fi else echo "telegraf-ama-logs-process-metrics.conf not found, skipping ama-logs process metrics monitoring" diff --git a/monitoring/internal-ade-dashboard/(New)Container-Insights-Logs-Addon-with-ProcessMetrics-readable.json b/monitoring/internal-ade-dashboard/(New)Container-Insights-Logs-Addon-with-ProcessMetrics-readable.json new file mode 100644 index 000000000..e69de29bb diff --git a/monitoring/internal-ade-dashboard/README.md b/monitoring/internal-ade-dashboard/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/monitoring/internal-ade-dashboard/_edit_dashboard.py b/monitoring/internal-ade-dashboard/_edit_dashboard.py new file mode 100644 index 000000000..e69de29bb diff --git a/monitoring/internal-ade-dashboard/_fix_param.py b/monitoring/internal-ade-dashboard/_fix_param.py new file mode 100644 index 000000000..e69de29bb