Add sentry

This commit is contained in:
2022-04-24 14:32:40 +03:00
parent 44dcde0df8
commit 6f859445c8
7 changed files with 67 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ from prometheus_fastapi_instrumentator import Instrumentator
from app.views import router, healthcheck_router
from core.arq_pool import get_arq_pool
from core.db import database
import core.sentry # noqa: F401
def start_app() -> FastAPI:

View File

@@ -23,5 +23,7 @@ class EnvConfig(BaseSettings):
REDIS_PORT: int
REDIS_DB: int
SENTRY_SDN: str
env_config = EnvConfig()

8
src/core/sentry.py Normal file
View File

@@ -0,0 +1,8 @@
import sentry_sdk
from core.config import env_config
sentry_sdk.init(
env_config.SENTRY_SDN,
)

View File

@@ -7,6 +7,7 @@ from app.services.cache_updater import (
)
from core.arq_pool import get_redis_settings, get_arq_pool
from core.db import database
import core.sentry # noqa: F401
async def startup(ctx):