mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
feat: integrate Rollbar for error tracking
This commit is contained in:
parent
ed65cf8871
commit
b078b953a6
2 changed files with 13 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue