mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #16192] [MERGED] feat: otel logger handler #62913
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/16192
Author: @expruc
Created: 7/31/2025
Status: ✅ Merged
Merged: 8/2/2025
Merged by: @tjbck
Base:
dev← Head:feat/otel-logger-handler📝 Commits (2)
2035eabadded otel logging handler49926f0Merge branch 'dev' into feat/otel-logger-handler📊 Changes
3 files changed (+59 additions, -3 deletions)
View changed files
📝
backend/open_webui/env.py(+1 -0)📝
backend/open_webui/utils/logger.py(+5 -3)➕
backend/open_webui/utils/telemetry/logs.py(+53 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Added an integration to otel logging handler as part of the default handler for the loguru logger.
Added
ENABLE_OTEL_LOGSwhich controls the activation of the logging handler.Additional Information
Note about implementation: this PR changes the way otel logs are handled, compared to metrics/traces which are handled through the
setupfunction. The reason for this, is setting this up using the otelsetupfunction would require patching the loggers on runtime (after the application has started), which seemed to cause problems especially with the uvicorn logger.Also, the otel handler is added only if both
ENABLE_OTELandENABLE_OTEL_LOGSare enabled, to comply with the way otel metrics are enabled.Documentation: if this PR will be approved I will create a separate PR for the docs.
Screenshots or Videos
Snippet from grafana showing the application logs

Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.