From 9cf6108527e4d1c6d8f8c078f6a2d42ce0140f25 Mon Sep 17 00:00:00 2001 From: Shamil Date: Fri, 6 Mar 2026 23:24:24 +0300 Subject: [PATCH] feat: add otel system metrics instrumentation (#22265) --- backend/open_webui/utils/telemetry/instrumentors.py | 2 ++ backend/requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/backend/open_webui/utils/telemetry/instrumentors.py b/backend/open_webui/utils/telemetry/instrumentors.py index 17536b9ad..25cd027d0 100644 --- a/backend/open_webui/utils/telemetry/instrumentors.py +++ b/backend/open_webui/utils/telemetry/instrumentors.py @@ -20,6 +20,7 @@ from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.instrumentation.requests import RequestsInstrumentor from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor +from opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor from opentelemetry.trace import Span, StatusCode from redis import Redis from redis.cluster import RedisCluster @@ -204,6 +205,7 @@ class Instrumentor(BaseInstrumentor): request_hook=aiohttp_request_hook, response_hook=aiohttp_response_hook, ) + SystemMetricsInstrumentor().instrument() def _uninstrument(self, **kwargs): if getattr(self, "instrumentors", None) is None: diff --git a/backend/requirements.txt b/backend/requirements.txt index 76940d370..06fb3b819 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -155,3 +155,4 @@ opentelemetry-instrumentation-requests==0.60b1 opentelemetry-instrumentation-logging==0.60b1 opentelemetry-instrumentation-httpx==0.60b1 opentelemetry-instrumentation-aiohttp-client==0.60b1 +opentelemetry-instrumentation-system-metrics==0.60b1