mirror of
https://github.com/flibusta-apps/telegram_files_server.git
synced 2025-12-06 12:35:39 +01:00
Add sentry
This commit is contained in:
@@ -2,12 +2,19 @@ from fastapi import FastAPI
|
||||
from fastapi.responses import ORJSONResponse
|
||||
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
import sentry_sdk
|
||||
|
||||
from app.on_start import on_start
|
||||
from app.views import router, healthcheck_router
|
||||
from core.config import env_config
|
||||
from core.db import database
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_DSN,
|
||||
)
|
||||
|
||||
|
||||
def start_app() -> FastAPI:
|
||||
app = FastAPI(default_response_class=ORJSONResponse)
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ class EnvConfig(BaseSettings):
|
||||
TELETHON_APP_CONFIG: Optional[TelethonConfig]
|
||||
TELETHON_SESSIONS: Optional[list[TelethonSessionName]]
|
||||
|
||||
SENTRY_DSN: str
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
|
||||
Reference in New Issue
Block a user