Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
exe = "ruby"
interval = "60s"
pid_finder = "native"
pid_tag = true
Expand All @@ -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/"
Expand Down Expand Up @@ -109,7 +111,6 @@

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
pattern = "fluentd"
interval = "60s"
pid_finder = "native"
pid_tag = true
Expand All @@ -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/"
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
14 changes: 8 additions & 6 deletions kubernetes/linux/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Empty file.
Empty file.
Empty file.
Loading