File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 10
10
from flask_sqlalchemy import SQLAlchemy
11
11
from raven .contrib .flask import Sentry
12
12
13
+ import sentry_sdk
14
+ from sentry_sdk .integrations .flask import FlaskIntegration
15
+ from sentry_sdk .integrations .sqlalchemy import SqlalchemyIntegration
16
+
13
17
app = Flask (__name__ )
14
18
gzip = Gzip (app )
15
19
24
28
25
29
db = SQLAlchemy (app )
26
30
migrate = Migrate (app , db )
31
+
32
+ # Sentry setup
27
33
sentry = Sentry (app )
34
+ sentry_sdk .init (
35
+ dsn = app .config ['SENTRY_DSN' ],
36
+ integrations = [FlaskIntegration (), SqlalchemyIntegration ()]
37
+ )
28
38
29
39
ldap = CSHLDAP (app .config ['LDAP_BIND_DN' ],
30
40
app .config ['LDAP_BIND_PW' ],
Original file line number Diff line number Diff line change 26
26
27
27
# Sentry config
28
28
# Do not set the DSN for local development
29
+ SENTRY_DSN = env .get ("CONDITIONAL_SENTRY_DSN" , "" )
29
30
SENTRY_CONFIG = {
30
31
'dsn' : env .get ("CONDITIONAL_SENTRY_DSN" , "" ),
31
32
'release' : VERSION ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pylint~=2.3.1
23
23
python-dateutil ~= 2.6.1
24
24
python-editor ~= 1.0.3
25
25
raven ~= 6.6.0
26
+ sentry-sdk ~= 0.13.1
26
27
six ~= 1.11.0
27
28
SQLAlchemy ~= 1.3.7
28
29
structlog ~= 18.1.0
You can’t perform that action at this time.
0 commit comments