feat: integrate Rollbar for error tracking

This commit is contained in:
LoiTra 2025-07-16 11:42:30 +07:00 committed by loitragg
parent ed65cf8871
commit b078b953a6
No known key found for this signature in database
GPG key ID: 96292BAF3E28CFF5
2 changed files with 13 additions and 0 deletions

View file

@ -518,6 +518,13 @@ from open_webui.tasks import (
from open_webui.utils.redis import get_sentinels_from_env
ROLLBAR_ACCESS_TOKEN = os.environ.get("ROLLBAR_ACCESS_TOKEN", "")
if ROLLBAR_ACCESS_TOKEN:
import rollbar
# Initialize Rollbar SDK with your server-side access token
rollbar.init(ROLLBAR_ACCESS_TOKEN)
from open_webui.constants import ERROR_MESSAGES
@ -633,6 +640,10 @@ app = FastAPI(
redoc_url=None,
lifespan=lifespan,
)
if ROLLBAR_ACCESS_TOKEN:
from rollbar.contrib.fastapi import add_to as rollbar_add_to
rollbar_add_to(app)
# For Open WebUI OIDC/OAuth2
oauth_manager = OAuthManager(app)

View file

@ -150,3 +150,5 @@ opentelemetry-instrumentation-requests==0.59b0
opentelemetry-instrumentation-logging==0.59b0
opentelemetry-instrumentation-httpx==0.59b0
opentelemetry-instrumentation-aiohttp-client==0.59b0
rollbar==1.3.0