Skip to content

Commit

Permalink
Add sentry sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
nezhar committed Nov 3, 2023
1 parent dc4dfcb commit ee5b814
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ django-gravatar2>=1.4.4,<1.5
django-linear-migrations>=2.8.0,<2.13
pytest-django>=4.5.2,<4.6
pytest-cov>=4.1.0,<4.2
sentry-sdk>=1.34.0,<1.35
12 changes: 9 additions & 3 deletions snypy/snypy/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import environ

import sentry_sdk

env = environ.Env(
# set casting, default value
Expand All @@ -22,8 +22,6 @@
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS")

# Application definition

INSTALLED_APPS = [
# core
"django.contrib.admin",
Expand Down Expand Up @@ -170,3 +168,11 @@
"REDOC_DIST": "SIDECAR",
"COMPONENT_SPLIT_REQUEST": True,
}

# Sentry
if env("SENTRY_ENABLED", default=False):
sentry_sdk.init(
dsn=env("SENTRY_DSN"),
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
)

0 comments on commit ee5b814

Please sign in to comment.