From f91aa8e93935ff88c352a1bdeb1acd812c7afb07 Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Thu, 16 Nov 2023 12:42:01 -0800 Subject: [PATCH] [fix] Windows liveness probe for ME (#678) --- RELEASENOTES.md | 5 +++- otelcollector/VERSION | 2 +- .../build/windows/scripts/livenessprobe.cmd | 30 +++++++++---------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f90f3b063..2521ba1d9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,9 @@ # Azure Monitor Metrics for AKS clusters -## Pending +## Release 11-16-2023 +* Windows image - `mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector/images:6.8.2-main--win +* Change log - + * Fix Windows liveness probe for error level evaluation ## Release 11-03-2023 * Linux image - `mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector/images:6.8.1-main-11-03-2023-c061beb4` diff --git a/otelcollector/VERSION b/otelcollector/VERSION index 5f6c0863a..166d79d6d 100644 --- a/otelcollector/VERSION +++ b/otelcollector/VERSION @@ -1 +1 @@ -6.8.1 +6.8.2 diff --git a/otelcollector/build/windows/scripts/livenessprobe.cmd b/otelcollector/build/windows/scripts/livenessprobe.cmd index eaf493d3f..61fce800f 100644 --- a/otelcollector/build/windows/scripts/livenessprobe.cmd +++ b/otelcollector/build/windows/scripts/livenessprobe.cmd @@ -12,9 +12,9 @@ set /a durationInMinutes = -1 if "%MAC%" == "" ( rem Non-MAC mode tasklist /fi "imagename eq MetricsExtension.Native.exe" /fo "table" | findstr MetricsExtension > nul - if errorlevel 1 ( + if %ERRORLEVEL% NEQ 0 ( echo "Metrics Extension is not running (Non-MAC mode)" - exit /b 1 + exit /B 1 ) ) else ( if "%MAC%" == "true" ( @@ -33,19 +33,19 @@ if "%MAC%" == "" ( ) if !durationInMinutes! GTR 15 ( echo "Greater than 15 mins, No configuration present for the AKS resource" - exit /b 1 + exit /B 1 ) ) ) else ( tasklist /fi "imagename eq MetricsExtension.Native.exe" /fo "table" | findstr MetricsExtension > nul - if errorlevel 1 ( + if %ERRORLEVEL% NEQ 0 ( echo "Metrics Extension is not running (configuration exists)" - exit /b 1 + exit /B 1 ) tasklist /fi "imagename eq MonAgentLauncher.exe" /fo "table" | findstr MonAgentLauncher > nul - if errorlevel 1 ( + if %ERRORLEVEL% NEQ 0 ( echo "MonAgentLauncher is not running (configuration exists)" - exit /b 1 + exit /B 1 ) ) ) @@ -53,31 +53,31 @@ if "%MAC%" == "" ( @REM "Checking if fluent-bit is running" tasklist /fi "imagename eq fluent-bit.exe" /fo "table" | findstr fluent-bit -if errorlevel 1 ( +if %ERRORLEVEL% NEQ 0 ( echo "Fluent-Bit is not running" - exit /b 1 + exit /B 1 ) @REM "Checking if config map has been updated since agent start" if exist "C:\opt\microsoft\scripts\filesystemwatcher.txt" ( echo "Config Map Updated or DCR/DCE updated since agent started" - exit /b 1 + exit /B 1 ) @REM REM "Checking if Telegraf is running" tasklist /fi "imagename eq telegraf.exe" /fo "table" | findstr telegraf -if errorlevel 1 ( +if %ERRORLEVEL% NEQ 0 ( echo "Telegraf is not running" - exit /b 1 + exit /B 1 ) @REM REM "Checking if otelcollector is running" tasklist /fi "imagename eq otelcollector.exe" /fo "table" | findstr otelcollector -if errorlevel 1 ( +if %ERRORLEVEL% NEQ 0 ( echo "otelcollector is not running" - exit /b 1 + exit /B 1 ) endlocal -exit /b 0 +exit /B 0