Skip to content

Commit 254692a

Browse files
committed
Updates to Sentry SDK config and env vars
- Set `debug` and `attach_stacktrace` to `False` - Reordered a bit - Added a decent way to make an env var work as a boolean - Better formatting (spaces around `=`)
1 parent b7be446 commit 254692a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/server/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
SENTRY_DSN = os.environ.get('SENTRY_DSN')
1919
if SENTRY_DSN:
2020
sentry_sdk.init(
21-
dsn=SENTRY_DSN,
22-
traces_sample_rate=float(os.environ.get('SENTRY_TRACES_SAMPLE_RATE', 1.0)),
23-
profiles_sample_rate=float(os.environ.get('SENTRY_PROFILES_SAMPLE_RATE', 1.0)),
24-
environment=str(os.environ.get('SENTRY_ENVIRONMENT', 'development')),
25-
debug=str(os.environ.get('SENTRY_DEBUG', 'True')),
26-
attach_stacktrace=str(os.environ.get('SENTRY_ATTACH_STACKTRACE', 'True'))
21+
dsn = SENTRY_DSN,
22+
environment = os.environ.get('SENTRY_ENVIRONMENT', 'development'),
23+
profiles_sample_rate = float(os.environ.get('SENTRY_PROFILES_SAMPLE_RATE', 1.0)),
24+
traces_sample_rate = float(os.environ.get('SENTRY_TRACES_SAMPLE_RATE', 1.0)),
25+
attach_stacktrace = os.environ.get('SENTRY_ATTACH_STACKTRACE', 'False').lower() in ('true', '1', 't'),
26+
debug = os.environ.get('SENTRY_DEBUG', 'False').lower() in ('true', '1', 't')
2727
)
2828

2929

0 commit comments

Comments
 (0)