File tree 6 files changed +19
-19
lines changed
6 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 8
8
from flask_gzip import Gzip
9
9
from flask_pyoidc .flask_pyoidc import OIDCAuthentication
10
10
from flask_sqlalchemy import SQLAlchemy
11
- from raven .contrib .flask import Sentry
12
11
13
12
import sentry_sdk
14
13
from sentry_sdk .integrations .flask import FlaskIntegration
30
29
migrate = Migrate (app , db )
31
30
32
31
# Sentry setup
33
- sentry = Sentry (app )
34
32
sentry_sdk .init (
35
33
dsn = app .config ['SENTRY_DSN' ],
36
- integrations = [FlaskIntegration (), SqlalchemyIntegration ()]
34
+ integrations = [FlaskIntegration (), SqlalchemyIntegration ()],
35
+ environment = app .config ['SENTRY_ENV' ],
37
36
)
38
37
39
38
ldap = CSHLDAP (app .config ['LDAP_BIND_DN' ],
@@ -190,8 +189,7 @@ def route_errors(error, user_dict=None):
190
189
return render_template ('errors.html' ,
191
190
error = error_desc ,
192
191
error_code = code ,
193
- event_id = g .sentry_event_id ,
194
- public_dsn = sentry .client .get_public_dsn ('https' ),
192
+ event_id = sentry_sdk .last_event_id (),
195
193
** data ), int (code )
196
194
197
195
Original file line number Diff line number Diff line change 25
25
LDAP_BIND_PW = env .get ("CONDITIONAL_LDAP_BIND_PW" , "" )
26
26
27
27
# Sentry config
28
- # Do not set the DSN for local development
28
+ # Not required for local development, but if you set it, make sure the
29
+ # SENTRY_ENV is 'local-development'
29
30
SENTRY_DSN = env .get ("CONDITIONAL_SENTRY_DSN" , "" )
30
31
SENTRY_CONFIG = {
31
32
'dsn' : env .get ("CONDITIONAL_SENTRY_LEGACY_DSN" , "" ),
32
33
'release' : VERSION ,
33
34
}
35
+ SENTRY_ENV = env .get ("CONDITIONAL_SENTRY_ENV" , "local-development" )
34
36
35
37
# OIDC Config
36
38
OIDC_ISSUER = env .get ("CONDITIONAL_OIDC_ISSUER" , "https://sso.csh.rit.edu/auth/realms/csh" )
Original file line number Diff line number Diff line change 1
- // Install Raven to send errors to Sentry
2
- import Raven from 'raven-js' ;
3
- Raven
4
- . config ( 'https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175' )
5
- . install ( ) ;
1
+ // Install Sentry to send errors to Sentry
2
+ import * as Sentry from '@sentry/browser' ;
3
+ Sentry . init (
4
+ {
5
+ dsn : 'https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175'
6
+ }
7
+ ) ;
6
8
7
9
// Capture unhandled exceptions in promises
8
10
window . addEventListener ( 'unhandledrejection' , err => {
9
- Raven . captureException ( err . reason ) ;
11
+ Sentry . captureException ( err . reason ) ;
10
12
} ) ;
11
13
12
14
// Load the rest of the modules
Original file line number Diff line number Diff line change 1
- import Raven from 'raven-js ' ;
1
+ import * as Sentry from '@sentry/browser ' ;
2
2
3
3
export default class ErrorReport {
4
4
constructor ( btn ) {
@@ -8,11 +8,11 @@ export default class ErrorReport {
8
8
}
9
9
10
10
render ( ) {
11
- this . btn . addEventListener ( 'click' , ( ) => this . _invokeRavenModal ( ) ) ;
11
+ this . btn . addEventListener ( 'click' , ( ) => this . _invokeSentryModal ( ) ) ;
12
12
}
13
13
14
- _invokeRavenModal ( ) {
15
- Raven . showReportDialog ( {
14
+ _invokeSentryModal ( ) {
15
+ Sentry . showReportDialog ( {
16
16
eventId : this . eventId
17
17
} ) ;
18
18
}
Original file line number Diff line number Diff line change 25
25
"demo" : " gulp production"
26
26
},
27
27
"dependencies" : {
28
+ "@sentry/browser" : " ^5.29.2" ,
28
29
"bootstrap" : " ^3.3.6" ,
29
30
"bootstrap-material-datetimepicker" : " https://github.com/T00rk/bootstrap-material-datetimepicker.git#gh-pages" ,
30
31
"bootstrap-sass" : " ^3.4.1" ,
89
90
"object-assign" : " 4.1.0" ,
90
91
"open" : " 0.0.5" ,
91
92
"pretty-hrtime" : " 1.0.2" ,
92
- "raven-js" : " ^3.27.2" ,
93
93
"require-dir" : " 1.2.0" ,
94
94
"sinon" : " 1.17.4" ,
95
95
"sinon-chai" : " 2.8.0" ,
Original file line number Diff line number Diff line change @@ -18,11 +18,9 @@ MarkupSafe~=1.0
18
18
mccabe ~= 0.6.1
19
19
oic ~= 0.11.0
20
20
psycopg2 ~= 2.8.5
21
- pyldap ~= 2.4.45
22
21
pylint ~= 2.6.0
23
22
python-dateutil ~= 2.6.1
24
23
python-editor ~= 1.0.3
25
- raven ~= 6.10.0
26
24
sentry-sdk [flask ]~= 0.19.5
27
25
six ~= 1.12.0
28
26
SQLAlchemy ~= 1.3.22
You can’t perform that action at this time.
0 commit comments