Skip to content

Commit

Permalink
Add sentry error tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 committed Oct 8, 2024
1 parent 9165b7c commit c09f835
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 276 deletions.
1 change: 1 addition & 0 deletions beaverhabits/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class StorageType(Enum):

class Settings(BaseSettings):
ENV: str = "dev"
SENTRY_DSN: str = ""

# UI config
INDEX_HABIT_ITEM_COUNT: int = 5
Expand Down
5 changes: 5 additions & 0 deletions beaverhabits/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from contextlib import asynccontextmanager

from fastapi import FastAPI
import sentry_sdk

from .app.app import init_auth_routes
from .app.db import create_db_and_tables
Expand Down Expand Up @@ -40,6 +41,10 @@ def read_root():
init_auth_routes(app)
init_gui_routes(app)

# sentry
if settings.SENTRY_DSN:
sentry_sdk.init(settings.SENTRY_DSN)


if __name__ == "__main__":
print(
Expand Down
Loading

0 comments on commit c09f835

Please sign in to comment.