Skip to content

Commit 8a5efe5

Browse files
authored
Fix Telegraf Env Handling issue (#1645)
1 parent 04338ed commit 8a5efe5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

kubernetes/linux/main.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ else
12141214
if [ "${CONTAINER_TYPE}" == "PrometheusSidecar" ] && [ -e "/opt/telegraf-test-prom-side-car.conf" ]; then
12151215
if [ "${MUTE_PROM_SIDECAR}" != "true" ]; then
12161216
echo "****************Start Telegraf in Test Mode**************************"
1217-
/opt/telegraf --config /opt/telegraf-test-prom-side-car.conf --input-filter file -test
1217+
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test-prom-side-car.conf --input-filter file -test
12181218
if [ $? -eq 0 ]; then
12191219
mv "/opt/telegraf-test-prom-side-car.conf" "/etc/opt/microsoft/docker-cimprov/telegraf-prom-side-car.conf"
12201220
echo "Moving test conf file to telegraf side-car conf since test run succeeded"
@@ -1226,7 +1226,7 @@ else
12261226
else
12271227
if [ -e "/opt/telegraf-test.conf" ]; then
12281228
echo "****************Start Telegraf in Test Mode**************************"
1229-
/opt/telegraf --config /opt/telegraf-test.conf --input-filter file -test
1229+
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test.conf --input-filter file -test
12301230
if [ $? -eq 0 ]; then
12311231
mv "/opt/telegraf-test.conf" "/etc/opt/microsoft/docker-cimprov/telegraf.conf"
12321232
echo "Moving test conf file to telegraf daemonset conf since test run succeeded"
@@ -1237,7 +1237,7 @@ else
12371237
else
12381238
if [ -e "/opt/telegraf-test-rs.conf" ]; then
12391239
echo "****************Start Telegraf in Test Mode**************************"
1240-
/opt/telegraf --config /opt/telegraf-test-rs.conf --input-filter file -test
1240+
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test-rs.conf --input-filter file -test
12411241
if [ $? -eq 0 ]; then
12421242
mv "/opt/telegraf-test-rs.conf" "/etc/opt/microsoft/docker-cimprov/telegraf-rs.conf"
12431243
echo "Moving test conf file to telegraf replicaset conf since test run succeeded"
@@ -1389,7 +1389,7 @@ elif [ "${MUTE_PROM_SIDECAR}" != "true" ]; then
13891389
elif [ "${CONTROLLER_TYPE}" != "ReplicaSet" ] && [ "${CONTAINER_TYPE}" != "PrometheusSidecar" ] && [ "${LOGS_AND_EVENTS_ONLY}" == "true" ]; then
13901390
echo "not starting telegraf for LOGS_AND_EVENTS_ONLY daemonset"
13911391
else
1392-
/opt/telegraf --config $telegrafConfFile &
1392+
/opt/telegraf --non-strict-env-handling --config $telegrafConfFile &
13931393
fi
13941394
else
13951395
echo "not starting telegraf (no metrics to scrape since MUTE_PROM_SIDECAR is true)"
@@ -1413,7 +1413,7 @@ if [ "${AZMON_COLLECT_AMA_LOGS_PROCESS_METRICS}" == "true" ]; then
14131413
appinsightsKey=$(echo "$APPLICATIONINSIGHTS_AUTH" | base64 -d | tr -d '\n')
14141414
sed -i -e "s/placeholder_appinsights_key/$appinsightsKey/g" $amaLogsProcessMetricsConfFile
14151415
# Use /proc so telegraf only collect process metrics inside ama-logs containers.
1416-
HOST_PROC=/proc /opt/telegraf --config $amaLogsProcessMetricsConfFile &
1416+
HOST_PROC=/proc /opt/telegraf --non-strict-env-handling --config $amaLogsProcessMetricsConfFile &
14171417
else
14181418
echo "APPLICATIONINSIGHTS_AUTH or AKS_RESOURCE_ID not set, skipping ama-logs process metrics monitoring"
14191419
fi

kubernetes/linux/setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sudo update-ca-trust
1616
# the mariner package version is behind the global packages so we are using different versions for arm64 and x86_64
1717
if [ "$ARCH" == "arm64" ]; then
1818
sudo tdnf install ruby-3.3.5-7.azl3.aarch64 -y
19+
sudo tdnf install zlib-devel -y
1920
else
2021
tdnf install -y gcc patch bzip2 openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
2122
wget https://github.com/rbenv/ruby-build/archive/refs/tags/v20251023.tar.gz -O ruby-build.tar.gz

0 commit comments

Comments
 (0)