mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[PR #16222] [MERGED] feat: separate otel metrics configuration #62929
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/16222
Author: @expruc
Created: 8/2/2025
Status: ✅ Merged
Merged: 8/2/2025
Merged by: @tjbck
Base:
dev← Head:feat/seperate_otel_metrics_config📝 Commits (1)
a679fb3split otel metrics from general otel configuration📊 Changes
3 files changed (+66 additions, -20 deletions)
View changed files
📝
backend/open_webui/env.py(+17 -0)📝
backend/open_webui/utils/telemetry/metrics.py(+46 -14)📝
backend/open_webui/utils/telemetry/setup.py(+3 -6)📄 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
This PR adds couple of configuration specific for open telemetry metrics configuration in order to distinguish them from the general otel configuration. This is handy especially in cases where separate endpoint for traces and metrics are used. One example is if lgtm stack is used, and the span exporter is http, where the endpoint for traces is
http://grafana:4318/v1/tracesand the metrics endpoint ishttp://grafana:4318/v1/metrics.Also, this PR adds http metrics exporter (alongside with the existing grpc one), and handles metrics exporter authentication.
This should also resolve #16183.
Added
New configuration/environment variables:
OTEL_METRICS_EXPORTER_OTLP_ENDPOINT- otel metrics exporter endpoint, defaults to theOTEL_EXPORTER_OTLP_ENDPOINTone if not specifiedOTEL_METRICS_BASIC_AUTH_USERNAMEandOTEL_METRICS_BASIC_AUTH_PASSWORD- basic credentials for authentication handling in metrics endpoint. Defaults to the traces credentials.OTEL_METRICS_OTLP_SPAN_EXPORTER- the span method for the metrics exporter (http/grpc). Defaults to the traces span exporter methodOTEL_METRICS_EXPORTER_OTLP_INSECURE- whether the exporter should be insecure or not. Defaults toFalselike the traces one.Changed
Moved
resourcedefinition to the otelsetup.pyto avoid code duplication.Fixed
Additional Information
If this PR is approved I will create a docs PR.
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.