Skip to content

Commit

Permalink
Disable Sentry except when explicitly enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensge committed Aug 27, 2024
1 parent 4eafacc commit 77eb1f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ RECORDER_ENABLED=False
INSECURE_COOKIES=True
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=admin
STEAM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
STEAM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SENTRY_ENABLED=False
22 changes: 12 additions & 10 deletions Spybot2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
STEAM_API_KEY = env('STEAM_API_KEY')

# Sentry SDK
SENTRY_ENABLED = env('SENTRY_ENABLED', False)
SENTRY_DSN = env('SENTRY_DSN')

# SECURITY WARNING: don't run with debug turned on in production!
Expand Down Expand Up @@ -230,13 +231,14 @@
'javascript_in_head': False,
}

sentry_sdk.init(
dsn=SENTRY_DSN,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)
if SENTRY_ENABLED:
sentry_sdk.init(
dsn=SENTRY_DSN,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)

0 comments on commit 77eb1f4

Please sign in to comment.