mirror of https://github.com/open-webui/open-webui
refac
This commit is contained in:
parent
7bfda6652f
commit
396c28817c
|
@ -437,7 +437,7 @@ AUDIT_EXCLUDED_PATHS = [path.lstrip("/") for path in AUDIT_EXCLUDED_PATHS]
|
|||
# OPENTELEMETRY
|
||||
####################################
|
||||
|
||||
OTEL_SDK_DISABLED = os.environ.get("OTEL_SDK_DISABLED", "true").lower() == "true"
|
||||
ENABLE_OTEL = os.environ.get("ENABLE_OTEL", "False").lower() == "true"
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT = os.environ.get(
|
||||
"OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317"
|
||||
)
|
||||
|
|
|
@ -330,7 +330,7 @@ from open_webui.env import (
|
|||
BYPASS_MODEL_ACCESS_CONTROL,
|
||||
RESET_CONFIG_ON_START,
|
||||
OFFLINE_MODE,
|
||||
OTEL_SDK_DISABLED,
|
||||
ENABLE_OTEL,
|
||||
)
|
||||
|
||||
|
||||
|
@ -357,7 +357,7 @@ from open_webui.utils.oauth import OAuthManager
|
|||
from open_webui.utils.security_headers import SecurityHeadersMiddleware
|
||||
|
||||
from open_webui.tasks import stop_task, list_tasks # Import from tasks.py
|
||||
from open_webui.utils.trace.setup import setup
|
||||
from open_webui.utils.telemetry.setup import setup as setup_opentelemetry
|
||||
|
||||
if SAFE_MODE:
|
||||
print("SAFE MODE ENABLED")
|
||||
|
@ -434,8 +434,8 @@ app.state.LICENSE_METADATA = None
|
|||
#
|
||||
########################################
|
||||
|
||||
if not OTEL_SDK_DISABLED:
|
||||
setup(app=app, db_engine=engine)
|
||||
if not ENABLE_OTEL:
|
||||
setup_opentelemetry(app=app, db_engine=engine)
|
||||
|
||||
|
||||
########################################
|
||||
|
|
|
@ -26,7 +26,7 @@ from requests import PreparedRequest, Response
|
|||
from sqlalchemy import Engine
|
||||
from fastapi import status
|
||||
|
||||
from open_webui.utils.trace.constants import SPAN_REDIS_TYPE, SpanAttributes
|
||||
from open_webui.utils.telemetry.constants import SPAN_REDIS_TYPE, SpanAttributes
|
||||
|
||||
from open_webui.env import SRC_LOG_LEVELS
|
||||
|
|
@ -5,8 +5,8 @@ from opentelemetry.sdk.resources import SERVICE_NAME, Resource
|
|||
from opentelemetry.sdk.trace import TracerProvider
|
||||
from sqlalchemy import Engine
|
||||
|
||||
from open_webui.utils.trace.exporters import LazyBatchSpanProcessor
|
||||
from open_webui.utils.trace.instrumentors import Instrumentor
|
||||
from open_webui.utils.telemetry.exporters import LazyBatchSpanProcessor
|
||||
from open_webui.utils.telemetry.instrumentors import Instrumentor
|
||||
from open_webui.env import OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
|
||||
|
|
@ -130,5 +130,4 @@ opentelemetry-instrumentation-redis==0.51b0
|
|||
opentelemetry-instrumentation-requests==0.51b0
|
||||
opentelemetry-instrumentation-logging==0.51b0
|
||||
opentelemetry-instrumentation-httpx==0.51b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.51b0
|
||||
opentelemetry-instrumentation-loguru==0.51b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.51b0
|
Loading…
Reference in New Issue