From e9a9c9e31f04b26d32fe9b6d322134dabe08c91c Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 18 Apr 2023 14:29:30 -0700 Subject: [PATCH] Update telemetry.sh with threshold config (#14615) #### Why I did it Threshold is a new config field passed to telelemetry.go as parameter #### How I did it Add check for threshold #### How to verify it Modify telemetry.sh, systemctl restart telemetry, telemetry process has threshold of 100 --- dockers/docker-sonic-telemetry/telemetry.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dockers/docker-sonic-telemetry/telemetry.sh b/dockers/docker-sonic-telemetry/telemetry.sh index 8f116134df..f0d16b212a 100755 --- a/dockers/docker-sonic-telemetry/telemetry.sh +++ b/dockers/docker-sonic-telemetry/telemetry.sh @@ -69,4 +69,11 @@ else TELEMETRY_ARGS+=" -v=2" fi +THRESHOLD_CONNECTIONS=$(echo $GNMI | jq -r '.threshold') +if [[ $THRESHOLD_CONNECTIONS =~ ^[0-9]+$ ]]; then + TELEMETRY_ARGS+=" --threshold $THRESHOLD_CONNECTIONS" +else + TELEMETRY_ARGS+=" --threshold 100" +fi + exec /usr/sbin/telemetry ${TELEMETRY_ARGS}