Add sentry

This commit is contained in:
2022-04-24 15:03:11 +03:00
parent f169178175
commit fdb9c5cc60
4 changed files with 62 additions and 1 deletions

View File

@@ -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)

View File

@@ -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"