diff --git a/kubernetes/linux/main.sh b/kubernetes/linux/main.sh index 14553e4b6..53aeb26d3 100644 --- a/kubernetes/linux/main.sh +++ b/kubernetes/linux/main.sh @@ -84,22 +84,40 @@ startAMACoreAgent() { echo "export AMACALogFilePath=$AMACALogFilePath" } >> ~/.bashrc - if isOpenTelemetryLogsEnabled; then - export PA_AMCS_PROTOCOL="HttpProtobuf" - export PA_AMCS_HOST="0.0.0.0" - export PA_AMCS_PORT=4319 + if isOpenTelemetryLogsEnabled; then + export OTLP_HTTP_PROTOBUF_LOGS_TRACES_HOST="0.0.0.0" + export OTLP_GRPC_LOGS_TRACES_HOST="0.0.0.0" + export OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT=4319 + export OTLP_GRPC_LOGS_TRACES_PORT=4320 if [ -n "${AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT}" ]; then # Convert AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT from string to int port_int=$((AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT + 0)) if [ "$port_int" -gt 0 ] 2>/dev/null; then - export PA_AMCS_PORT=$port_int + export OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT=$port_int fi fi + if [ -n "${AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT_GRPC}" ]; then + # Convert AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT_GRPC from string to int + port_grpc_int=$((AZMON_OPENTELEMETRYLOGS_CONTAINER_PORT_GRPC + 0)) + if [ "$port_grpc_int" -gt 0 ] 2>/dev/null; then + export OTLP_GRPC_LOGS_TRACES_PORT=$port_grpc_int + fi + fi + + { + echo "export OTLP_HTTP_PROTOBUF_LOGS_TRACES_HOST=$OTLP_HTTP_PROTOBUF_LOGS_TRACES_HOST" + echo "export OTLP_GRPC_LOGS_TRACES_HOST=$OTLP_GRPC_LOGS_TRACES_HOST" + echo "export OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT=$OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT" + echo "export OTLP_GRPC_LOGS_TRACES_PORT=$OTLP_GRPC_LOGS_TRACES_PORT" + } >> ~/.bashrc + else + echo "OpenTelemetry logs not enabled, disabling OTLP ports for AMACoreAgent" + export OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT=-1 + export OTLP_GRPC_LOGS_TRACES_PORT=-1 { - echo "export PA_AMCS_PROTOCOL=$PA_AMCS_PROTOCOL" - echo "export PA_AMCS_PORT=$PA_AMCS_PORT" - echo "export PA_AMCS_HOST=$PA_AMCS_HOST" + echo "export OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT=$OTLP_HTTP_PROTOBUF_LOGS_TRACES_PORT" + echo "export OTLP_GRPC_LOGS_TRACES_PORT=$OTLP_GRPC_LOGS_TRACES_PORT" } >> ~/.bashrc fi diff --git a/kubernetes/linux/setup.sh b/kubernetes/linux/setup.sh index 6bad0f72e..c45502562 100644 --- a/kubernetes/linux/setup.sh +++ b/kubernetes/linux/setup.sh @@ -41,7 +41,7 @@ gem uninstall net-imap --force # remove rexml gem as it has a known CVE (CVE-2025-58767) and is not used by the agent gem uninstall rexml --force -sudo tdnf install -y azure-mdsd-1.40.3 +sudo tdnf install -y azure-mdsd-1.42.0 cp -f $TMPDIR/mdsd.xml /etc/mdsd.d cp -f $TMPDIR/envmdsd /etc/mdsd.d rm /usr/sbin/telegraf