Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sentry support #388

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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