Skip to content

Commit

Permalink
feat: initial sentry setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tiftran committed Nov 25, 2022
1 parent ef61c76 commit 1f59a95
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
16 changes: 15 additions & 1 deletion consvc_shepherd/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path
from typing import List

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
import environ

env = environ.Env()
Expand Down Expand Up @@ -140,3 +141,16 @@
},
},
}
# Sentry Setup
SENTRY_SDK = env("SENTRY_SDK", default=None)
SENTRY_TRACE_SAMPLE_RATE = env("SENTRY_TRACE_SAMPLE_RATE", default=1.0)
sentry_sdk.init(
dsn=SENTRY_SDK,
integrations=[DjangoIntegration()],

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production,
traces_sample_rate=SENTRY_TRACE_SAMPLE_RATE,
debug=DEBUG,
)
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ psycopg2-binary
pytest
pytest-django
pytest-cov
sentry-sdk
10 changes: 8 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ black==22.10.0
cachetools==5.2.0
# via google-auth
certifi==2022.9.24
# via requests
# via
# requests
# sentry-sdk
cffi==1.15.1
# via cryptography
charset-normalizer==2.1.1
Expand Down Expand Up @@ -141,6 +143,8 @@ requests==2.28.1
# google-cloud-storage
rsa==4.9
# via google-auth
sentry-sdk==1.11.1
# via -r requirements.in
six==1.16.0
# via
# google-auth
Expand All @@ -167,4 +171,6 @@ typing-extensions==4.4.0
# django-stubs-ext
# mypy
urllib3==1.26.13
# via requests
# via
# requests
# sentry-sdk

0 comments on commit 1f59a95

Please sign in to comment.