feat(app): add sentry loging

This commit is contained in:
2025-10-17 15:59:18 +02:00
parent d593f7a994
commit cb9ef5e461
5 changed files with 24 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
import os
from fastapi import Depends, FastAPI
from fastapi.middleware.cors import CORSMiddleware
@@ -9,6 +11,16 @@ from app.api.categories import router as categories_router
from app.api.transactions import router as transactions_router
from app.services.user_service import auth_backend, current_active_verified_user, fastapi_users, get_oauth_provider
from fastapi import FastAPI
import sentry_sdk
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
send_default_pii=True,
)
app = FastAPI()
fastApi = FastAPI()
# CORS for frontend dev server
@@ -59,3 +71,7 @@ async def root():
@fastApi.get("/authenticated-route")
async def authenticated_route(user: User = Depends(current_active_verified_user)):
return {"message": f"Hello {user.email}!"}
@fastApi.get("/sentry-debug")
async def trigger_error():
division_by_zero = 1 / 0