@@ -60,19 +60,18 @@ getClusterCloudEnvironment() {
6060}
6161
6262startAMACoreAgent () {
63- echo " AMACoreAgent: Starting AMA Core Agent for otel"
64-
65- export AMACALogFileDir=" /var/opt/microsoft/azuremonitoragent/log"
63+ if isHighLogScaleMode; then
64+ echo " AMACoreAgent: Starting AMA Core Agent since High Log scale mode is enabled"
65+ fi
66+
67+ export AMACALogFileDir=" /var/opt/microsoft/linuxmonagent/amaca/log"
6668 export AMACALogFilePath=" $AMACALogFileDir " /amaca.log
67- export PA_DATA_PORT=13005
69+ export PA_DATA_PORT=13000
6870 export PA_GIG_BRIDGE_MODE=true
6971 export GIG_PA_ENABLE_OPTIMIZATION=true
7072 export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
7173 export PA_CONFIG_PORT=12563
7274 export CounterDataReportFrequencyInMinutes=60
73- export PA_AMCS_PROTOCOL=" HttpProtobuf"
74- export PA_AMCS_PORT=4319
75- export PA_AMCS_HOST=" 0.0.0.0"
7675
7776 {
7877 echo " export PA_DATA_PORT=$PA_DATA_PORT "
@@ -82,14 +81,30 @@ startAMACoreAgent() {
8281 echo " export PA_CONFIG_PORT=$PA_CONFIG_PORT "
8382 echo " export CounterDataReportFrequencyInMinutes=$CounterDataReportFrequencyInMinutes "
8483 echo " export AMACALogFilePath=$AMACALogFilePath "
85- echo " export PA_VERBOSE=true"
86- echo " export PA_AMCS_PROTOCOL=$PA_AMCS_PROTOCOL "
87- echo " export PA_AMCS_PORT=$PA_AMCS_PORT "
88- echo " export PA_AMCS_HOST=$PA_AMCS_HOST "
89- } >> ~ /.bashrc
84+ } >> ~ /.bashrc
85+
86+ if isOpenTelemetryLogsEnabled; then
87+ echo " AMACoreAgent: Starting AMA Core Agent for otel"
88+ export PA_AMCS_PROTOCOL=" HttpProtobuf"
89+ export PA_AMCS_HOST=" 0.0.0.0"
90+ export PA_AMCS_PORT=4319
91+ if [ -n " ${AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT} " ]; then
92+ # Convert AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT from string to int
93+ port_int=$(( AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT + 0 ))
94+ if [ " $port_int " -gt 0 ] 2> /dev/null; then
95+ export PA_AMCS_PORT=$port_int
96+ fi
97+ fi
98+
99+ {
100+ echo " export PA_AMCS_PROTOCOL=$PA_AMCS_PROTOCOL "
101+ echo " export PA_AMCS_PORT=$PA_AMCS_PORT "
102+ echo " export PA_AMCS_HOST=$PA_AMCS_HOST "
103+ } >> ~ /.bashrc
104+ fi
90105
91106 source ~ /.bashrc
92- /opt/microsoft/azure-mdsd/bin/amacoreagent --configport $PA_CONFIG_PORT --amacalog $AMACALogFilePath --giglaport $PA_DATA_PORT -v > /dev/null 2>&1 &
107+ /opt/microsoft/azure-mdsd/bin/amacoreagent --configport $PA_CONFIG_PORT --amacalog $AMACALogFilePath --giglaport $PA_DATA_PORT > /dev/null 2>&1 &
93108
94109 waitforlisteneronTCPport " $PA_DATA_PORT " " $WAITTIME_PORT_13000 "
95110 waitforlisteneronTCPport " $PA_CONFIG_PORT " " $WAITTIME_PORT_12563 "
@@ -237,6 +252,14 @@ isHighLogScaleMode() {
237252 fi
238253}
239254
255+ isOpenTelemetryLogsEnabled () {
256+ if [[ " ${APPMONITORING_OPENTELEMETRYLOGS_ENABLED} " == " true" ]]; then
257+ true
258+ else
259+ false
260+ fi
261+ }
262+
240263checkAgentOnboardingStatus () {
241264 local sleepdurationsecs=1
242265 local totalsleptsecs=0
@@ -1095,10 +1118,9 @@ if [ "${CONTAINER_TYPE}" == "PrometheusSidecar" ]; then
10951118 fi
10961119else
10971120 echo " starting mdsd in main container..."
1098- # if isHighLogScaleMode; then
1099- # start core agent for otlp
1100- startAMACoreAgent
1101- # fi
1121+ if isHighLogScaleMode || isOpenTelemetryLogsEnabled; then
1122+ startAMACoreAgent
1123+ fi
11021124 export MDSD_ROLE_PREFIX=/var/run/mdsd-ci/default
11031125 echo " export MDSD_ROLE_PREFIX=$MDSD_ROLE_PREFIX " >> ~ /.bashrc
11041126 if [[ " ${GENEVA_LOGS_INTEGRATION} " != " true" ]]; then
0 commit comments