From 314d7a387ac39ddda1662df536b2a4dd1ae80bd9 Mon Sep 17 00:00:00 2001 From: Kevin O'Brien Date: Tue, 11 Aug 2026 12:38:34 -0700 Subject: [PATCH] Open WebUI: add optional OpenTelemetry package install (#16415) --- ct/openwebui.sh | 9 ++++++++- install/openwebui-install.sh | 22 +++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index db1341922..2554239c4 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -114,7 +114,14 @@ EOF msg_info "Updating Open WebUI via uv" PYTHON_VERSION="3.12" setup_uv - $STD uv tool install --force --python 3.12 --constraint <(echo "numba>=0.60") open-webui[all] + OWUI_PYTHON="/root/.local/share/uv/tools/open-webui/bin/python3.12" + OTEL_ARGS=() + if [[ -x "$OWUI_PYTHON" ]]; then + while IFS= read -r pkg; do + OTEL_ARGS+=(--with "$pkg") + done < <(uv pip list --python "$OWUI_PYTHON" --format freeze 2>/dev/null | grep -i '^opentelemetry-' | cut -d= -f1) + fi + $STD uv tool install --force --python 3.12 --constraint <(echo "numba>=0.60") "${OTEL_ARGS[@]}" open-webui[all] systemctl restart open-webui msg_ok "Updated Open WebUI" msg_ok "Updated successfully!" diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index 4b82715a1..00a24dc5a 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -25,8 +25,28 @@ setup_hwaccel PYTHON_VERSION="3.12" setup_uv +OTEL_ARGS=() +read -r -p "${TAB3}Would you like to install OpenTelemetry instrumentation packages (requires manual .env configuration)? " prompt +if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + for pkg in \ + opentelemetry-api \ + opentelemetry-sdk \ + opentelemetry-exporter-otlp \ + opentelemetry-exporter-otlp-proto-http \ + opentelemetry-instrumentation-fastapi \ + opentelemetry-instrumentation-aiohttp-client \ + opentelemetry-instrumentation-httpx \ + opentelemetry-instrumentation-sqlalchemy \ + opentelemetry-instrumentation-requests \ + opentelemetry-instrumentation-logging \ + opentelemetry-instrumentation-redis \ + opentelemetry-instrumentation-system-metrics; do + OTEL_ARGS+=(--with "$pkg") + done +fi + msg_info "Installing Open WebUI" -$STD uv tool install --python 3.12 --constraint <(echo "numba>=0.60") open-webui[all] +$STD uv tool install --python 3.12 --constraint <(echo "numba>=0.60") "${OTEL_ARGS[@]}" open-webui[all] msg_ok "Installed Open WebUI" read -r -p "${TAB3}Would you like to add Ollama? " prompt