mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #22529] [MERGED] feat(otel): introduce an environment variable to control the export interval of otel metrics #130396
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/22529
Author: @lorenzophys
Created: 3/10/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @tjbck
Base:
dev← Head:metrics-export📝 Commits (1)
47cab96feat(otel): introduce an environment variable to control the export interval of otel metrics📊 Changes
2 files changed (+6 additions, -4 deletions)
View changed files
📝
backend/open_webui/env.py(+3 -0)📝
backend/open_webui/utils/telemetry/metrics.py(+3 -4)📄 Description
Description
Introduced an environment variable
OTEL_METRICS_EXPORT_INTERVAL_MILLISto control the export interval of the otel metrics. While it keeps the current default value it will allow us to control the amount of datapoints per minute.This is useful whenever one is charged based on metrics DPM. For example Grafana Cloud recommends staying below 1 DPM not to incur in higher cost.
Currently open-webui defaults to 6DPM, which is way above 1 DPM.
Added
OTEL_METRICS_EXPORT_INTERVAL_MILLISenvironment variable.Breaking Changes
Testing
docker-compose.yaml:otel-collector-config.yamlRun:
Then look at
./metrics.jsonand compare the timestampsA python script to convert the unix timestamp to a human readable format (I just hardcoded
timeUnixNano)Result
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.