Skip to content

Commit

Permalink
add sentry support
Browse files Browse the repository at this point in the history
  • Loading branch information
Her Email committed Nov 21, 2023
1 parent 7a6a8a4 commit 2f421f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boofilsic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
DISCORD_WEBHOOKS=(dict, {"user-report": None}),
# Slack API token, for sending exceptions to Slack, may deprecate in future
SLACK_API_TOKEN=(str, ""),
NEODB_SENTRY_DSN=(str, ""),
)

# ====== End of user configuration variables ======
Expand Down Expand Up @@ -508,3 +509,15 @@
# "PUT",
)
DEFAULT_RELAY_SERVER = "https://relay.neodb.net/actor"

SENTRY_DSN = env("NEODB_SENTRY_DSN")
if SENTRY_DSN:
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
release=NEODB_VERSION,
traces_sample_rate=1 if DEBUG else 0.01,
)
2 changes: 2 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ x-shared:
NEODB_LOGIN_MASTODON_WHITELIST:
NEODB_MASTODON_CLIENT_SCOPE:
NEODB_DISABLE_DEFAULT_RELAY:
NEODB_SENTRY_DSN:
TAKAHE_SENTRY_DSN:
NEODB_DB_URL: postgres://neodb:aubergine@neodb-db/neodb
TAKAHE_DB_URL: postgres://takahe:aubergine@takahe-db/takahe
NEODB_REDIS_URL: redis://redis:6379/0
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ podcastparser
psycopg2-binary
requests
rq>=1.12.0
sentry-sdk
setproctitle
tqdm
typesense
Expand Down

0 comments on commit 2f421f0

Please sign in to comment.