diff --git a/humitifier/dashboard.py b/humitifier/dashboard.py index 20a5e7a..a219ee4 100644 --- a/humitifier/dashboard.py +++ b/humitifier/dashboard.py @@ -11,6 +11,11 @@ from humitifier.models import Host, get_hosts from humitifier.logging import logging +import sentry_sdk + +if sentry_dsn := os.getenv("SENTRY_DSN"): + sentry_sdk.init(dsn=sentry_dsn, traces_sample_rate=1.0, profiles_sample_rate=1.0) + template_env = Environment(loader=FileSystemLoader("humitifier/templates")) app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") diff --git a/pyproject.toml b/pyproject.toml index 6c68649..1cde725 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ toml = "^0.10.2" parallel-ssh = "^2.12.0" rocketry = "^2.5.1" asyncpg = "^0.29.0" +sentry-sdk = {extras = ["fastapi"], version = "^1.41.0"} [tool.poetry.group.dev.dependencies]