Skip to content

Open WebUI: add optional OpenTelemetry package install#15744

Open
irishpadres wants to merge 1 commit into
community-scripts:mainfrom
irishpadres:feature/openwebui-otel
Open

Open WebUI: add optional OpenTelemetry package install#15744
irishpadres wants to merge 1 commit into
community-scripts:mainfrom
irishpadres:feature/openwebui-otel

Conversation

@irishpadres

Copy link
Copy Markdown
Contributor

✍️ Description

Open WebUI users who enable OpenTelemetry tracing/metrics currently have to manually reinstall the OTEL Python packages after every update, because update_script runs uv tool install --force, which fully recreates the tool's virtual environment and silently drops any package that isn't one of Open WebUI's own declared dependencies.

This adds an install-time prompt to optionally install the OpenTelemetry instrumentation packages (API, SDK, OTLP exporters, and instrumentation for FastAPI/aiohttp/httpx/SQLAlchemy/requests/logging/redis/system-metrics) via uv tool install --with <pkg>. update_script then detects whatever opentelemetry-* packages are currently installed in the live venv before reinstalling (uv pip list --format freeze | grep '^opentelemetry-') and re-supplies them as --with args, so they survive every future update automatically. This detection is based on live venv state rather than a persisted flag, so it also retroactively fixes containers that already had these packages added by hand before this change existed — no need to have used the prompt in the first place.

Users still need to configure the relevant OTEL_* variables in /root/.env themselves — this only handles package installation, not enabling/configuring OpenTelemetry itself.

Note: this only preserves OpenTelemetry packages specifically; any other manually uv pip install-ed package in this venv would still be dropped on update. Scoped to OpenTelemetry only, matching the actual problem being fixed here.

Tested: fresh install with the prompt answered "yes" (packages import correctly), update on a freshly-installed container with OTEL present (survives --force reinstall), update on an existing container that had OTEL packages added manually before this change existed with no prior marker (detected and preserved), and update on a container with no OTEL packages (no behavior change).

🔗 Related Issue

Fixes #

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to script metadata (PocketBase/website data).
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

Installs the OTEL instrumentation packages into the uv tool venv on request and
reinstalls them automatically after future updates, since uv tool install --force
otherwise wipes them from the environment. Requires manual .env configuration.
@irishpadres
irishpadres requested a review from a team as a code owner July 13, 2026 12:56
@github-actions github-actions Bot added feature update script A change that updates a script labels Jul 13, 2026
@irishpadres
irishpadres marked this pull request as draft July 13, 2026 13:01
@irishpadres
irishpadres marked this pull request as ready for review July 13, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature update script A change that updates a script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant