Open WebUI: add optional OpenTelemetry package install#15744
Open
irishpadres wants to merge 1 commit into
Open
Open WebUI: add optional OpenTelemetry package install#15744irishpadres wants to merge 1 commit into
irishpadres wants to merge 1 commit into
Conversation
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
marked this pull request as draft
July 13, 2026 13:01
irishpadres
marked this pull request as ready for review
July 13, 2026 13:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
Open WebUI users who enable OpenTelemetry tracing/metrics currently have to manually reinstall the OTEL Python packages after every update, because
update_scriptrunsuv 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_scriptthen detects whateveropentelemetry-*packages are currently installed in the live venv before reinstalling (uv pip list --format freeze | grep '^opentelemetry-') and re-supplies them as--withargs, 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/.envthemselves — 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
--forcereinstall), 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)
🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.