Skip to content

Commit 1e83a23

Browse files
authored
♻️ Set Sentry environment from config (#389)
1 parent 942abc4 commit 1e83a23

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/app/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Settings(BaseSettings):
4545
DEVICE_AUTH_POLL_INTERVAL_SECONDS: int = 5
4646

4747
FRONTEND_HOST: str = "http://localhost:5173"
48-
ENVIRONMENT: Literal["local", "staging", "production"] = "local"
48+
ENVIRONMENT: Literal["local", "development", "staging", "production"] = "local"
4949

5050
BACKEND_CORS_ORIGINS: Annotated[
5151
list[AnyUrl] | str,

backend/app/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ def custom_generate_unique_id(route: APIRoute) -> str:
1414

1515

1616
if settings.SENTRY_DSN and settings.ENVIRONMENT != "local":
17-
sentry_sdk.init(dsn=str(settings.SENTRY_DSN), enable_tracing=True)
17+
sentry_sdk.init(
18+
dsn=str(settings.SENTRY_DSN),
19+
enable_tracing=True,
20+
environment=settings.ENVIRONMENT,
21+
)
1822

1923
app = FastAPI(
2024
title=settings.PROJECT_NAME,

0 commit comments

Comments
 (0)