Skip to content

Commit e99f517

Browse files
committed
OTLP changes
1 parent 9e951ea commit e99f517

File tree

5 files changed

+46
-35
lines changed

5 files changed

+46
-35
lines changed

charts/azuremonitor-containers-geneva/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ image:
1717
repository: mcr.microsoft.com/azuremonitor/containerinsights/ciprod
1818
tag: "3.1.28"
1919
pullPolicy: IfNotPresent
20-
agentVersion: "azure-mdsd-1.35.8"
20+
agentVersion: "azure-mdsd-1.35.7"
2121
nameOverride: ""
2222
enableInternalMetrics: false
2323
enableKubernetesMetadata: false

kubernetes/ama-logs.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ spec:
343343
component: ama-logs-agent
344344
tier: node
345345
annotations:
346-
agentVersion: "azure-mdsd-1.35.8"
346+
agentVersion: "azure-mdsd-1.35.7"
347347
dockerProviderVersion: "18.0.1-0"
348348
schema-versions: "v1"
349349
kubernetes.azure.com/no-http-proxy-vars: "true"
@@ -454,6 +454,8 @@ spec:
454454
value: "false"
455455
- name: APPMONITORING_OPENTELEMETRYLOGS_PORT
456456
value: "28331"
457+
- name: AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT
458+
value: "4319"
457459
- name: AZMON_RETINA_FLOW_LOGS_ENABLED
458460
value: "false"
459461
- name: CLUSTER_CLOUD_ENVIRONMENT
@@ -475,7 +477,7 @@ spec:
475477
hostPort: 28330
476478
protocol: TCP
477479
- name: otlp-logs
478-
containerPort: 4317
480+
containerPort: 4319
479481
hostPort: 28331
480482
protocol: TCP
481483
volumeMounts:
@@ -788,7 +790,7 @@ spec:
788790
# labels:
789791
# rsName: "ama-logs-multitenancy"
790792
# annotations:
791-
# agentVersion: "azure-mdsd-1.35.8"
793+
# agentVersion: "azure-mdsd-1.35.7"
792794
# dockerProviderVersion: "18.0.1-0"
793795
# schema-versions: "v1"
794796
# kubernetes.azure.com/no-http-proxy-vars: "true"
@@ -963,7 +965,7 @@ spec:
963965
labels:
964966
rsName: "ama-logs-rs"
965967
annotations:
966-
agentVersion: "azure-mdsd-1.35.8"
968+
agentVersion: "azure-mdsd-1.35.7"
967969
dockerProviderVersion: "18.0.1-0"
968970
schema-versions: "v1"
969971
kubernetes.azure.com/no-http-proxy-vars: "true"
@@ -1097,10 +1099,6 @@ spec:
10971099
# value: "true"
10981100
- name: APPMONITORING_AUTOINSTRUMENTATION_ENABLED
10991101
value: "false"
1100-
- name: APPMONITORING_OPENTELEMETRYLOGS_ENABLED
1101-
value: "false"
1102-
- name: APPMONITORING_OPENTELEMETRYLOGS_PORT
1103-
value: "28331"
11041102
- name: AZMON_TELEGRAF_LIVENESSPROBE_ENABLED
11051103
value: "false"
11061104
- name: AZMON_WINDOWS_FLUENT_BIT_ENABLED

kubernetes/linux/Dockerfile.multiarch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ RUN tdnf install -y \
3434
gnupg \
3535
make \
3636
logrotate \
37-
unzip \
3837
busybox \
3938
gawk \
4039
tar \

kubernetes/linux/main.sh

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,18 @@ getClusterCloudEnvironment() {
6060
}
6161

6262
startAMACoreAgent() {
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+
240263
checkAgentOnboardingStatus() {
241264
local sleepdurationsecs=1
242265
local totalsleptsecs=0
@@ -1095,10 +1118,9 @@ if [ "${CONTAINER_TYPE}" == "PrometheusSidecar" ]; then
10951118
fi
10961119
else
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

kubernetes/linux/setup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ rm /usr/sbin/telegraf
4646
mdsd_version=$(sudo tdnf list installed | grep mdsd | awk '{print $2}')
4747
echo "Azure mdsd: $mdsd_version" >> packages_version.txt
4848

49-
# # install AMACA for otel
50-
# sudo curl -L -O https://github.com/microsoft/Docker-Provider/releases/download/windows-ama-bits/Azure.Monitor.CoreAgent.Linux-x64-AOT.2.0.31.nupkg
51-
# sudo unzip -o Azure.Monitor.CoreAgent.Linux-x64-AOT.2.0.31.nupkg -d amaca
52-
# sudo mkdir -p /opt/microsoft/azuremonitoragent
53-
# cp -r amaca/* /opt/microsoft/azuremonitoragent/
54-
# chmod +x /opt/microsoft/azuremonitoragent/content/AMACoreAgent
55-
# rm -rf amaca Azure.Monitor.CoreAgent.Linux-x64-AOT.2.0.31.nupkg
56-
5749
# log rotate conf for mdsd and can be extended for other log files as well
5850
cp -f $TMPDIR/logrotate.conf /etc/logrotate.d/ci-agent
5951

0 commit comments

Comments
 (0)