Skip to content

Commit

Permalink
Enable sentry for selfhosted
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihbaltaci committed Jan 27, 2025
1 parent e0d9c88 commit 4b9efe4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gurubase-backend/backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
ROOT_PASSWORD = config('ROOT_PASSWORD', default='ChangeMe')

SENTRY_ENABLED = config('SENTRY_ENABLED', default=False, cast=bool)
if SENTRY_ENABLED:

if SENTRY_ENABLED or ENV == "selfhosted":
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
SENTRY_DSN = config('SENTRY_DSN')
from sentry_sdk.integrations.django import DjangoIntegration
# Use the configured DSN or fallback to selfhosted DSN - https://sentry.zendesk.com/hc/en-us/articles/26741783759899-My-DSN-key-is-publicly-visible-is-this-a-security-vulnerability
SENTRY_DSN = config('SENTRY_DSN', default="https://[email protected]/4508715634982912")
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration(), CeleryIntegration(monitor_beat_tasks=False)],
Expand Down

0 comments on commit 4b9efe4

Please sign in to comment.