Skip to content

Commit 078599f

Browse files
committed
Adding sentry sdk
1 parent a611270 commit 078599f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

conditional/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from flask_sqlalchemy import SQLAlchemy
1111
from raven.contrib.flask import Sentry
1212

13+
import sentry_sdk
14+
from sentry_sdk.integrations.flask import FlaskIntegration
15+
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
16+
1317
app = Flask(__name__)
1418
gzip = Gzip(app)
1519

@@ -24,7 +28,13 @@
2428

2529
db = SQLAlchemy(app)
2630
migrate = Migrate(app, db)
31+
32+
# Sentry setup
2733
sentry = Sentry(app)
34+
sentry_sdk.init(
35+
dsn=app.config['SENTRY_DSN'],
36+
integrations=[FlaskIntegration(), SqlalchemyIntegration()]
37+
)
2838

2939
ldap = CSHLDAP(app.config['LDAP_BIND_DN'],
3040
app.config['LDAP_BIND_PW'],

config.env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
# Sentry config
2828
# Do not set the DSN for local development
29+
SENTRY_DSN = env.get("CONDITIONAL_SENTRY_DSN", "")
2930
SENTRY_CONFIG = {
3031
'dsn': env.get("CONDITIONAL_SENTRY_DSN", ""),
3132
'release': VERSION,

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pylint~=2.3.1
2323
python-dateutil~=2.6.1
2424
python-editor~=1.0.3
2525
raven~=6.6.0
26+
sentry-sdk~=0.13.1
2627
six~=1.11.0
2728
SQLAlchemy~=1.3.7
2829
structlog~=18.1.0

0 commit comments

Comments
 (0)