File tree Expand file tree Collapse file tree 6 files changed +19
-19
lines changed Expand file tree Collapse file tree 6 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 88from flask_gzip import Gzip
99from flask_pyoidc .flask_pyoidc import OIDCAuthentication
1010from flask_sqlalchemy import SQLAlchemy
11- from raven .contrib .flask import Sentry
1211
1312import sentry_sdk
1413from sentry_sdk .integrations .flask import FlaskIntegration
3029migrate = Migrate (app , db )
3130
3231# Sentry setup
33- sentry = Sentry (app )
3432sentry_sdk .init (
3533 dsn = app .config ['SENTRY_DSN' ],
36- integrations = [FlaskIntegration (), SqlalchemyIntegration ()]
34+ integrations = [FlaskIntegration (), SqlalchemyIntegration ()],
35+ environment = app .config ['SENTRY_ENV' ],
3736)
3837
3938ldap = CSHLDAP (app .config ['LDAP_BIND_DN' ],
@@ -190,8 +189,7 @@ def route_errors(error, user_dict=None):
190189 return render_template ('errors.html' ,
191190 error = error_desc ,
192191 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 (),
195193 ** data ), int (code )
196194
197195
Original file line number Diff line number Diff line change 2525LDAP_BIND_PW = env .get ("CONDITIONAL_LDAP_BIND_PW" , "" )
2626
2727# 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'
2930SENTRY_DSN = env .get ("CONDITIONAL_SENTRY_DSN" , "" )
3031SENTRY_CONFIG = {
3132 'dsn' : env .get ("CONDITIONAL_SENTRY_LEGACY_DSN" , "" ),
3233 'release' : VERSION ,
3334}
35+ SENTRY_ENV = env .get ("CONDITIONAL_SENTRY_ENV" , "local-development" )
3436
3537# OIDC Config
3638OIDC_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+ ) ;
68
79// Capture unhandled exceptions in promises
810window . addEventListener ( 'unhandledrejection' , err => {
9- Raven . captureException ( err . reason ) ;
11+ Sentry . captureException ( err . reason ) ;
1012} ) ;
1113
1214// 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 ' ;
22
33export default class ErrorReport {
44 constructor ( btn ) {
@@ -8,11 +8,11 @@ export default class ErrorReport {
88 }
99
1010 render ( ) {
11- this . btn . addEventListener ( 'click' , ( ) => this . _invokeRavenModal ( ) ) ;
11+ this . btn . addEventListener ( 'click' , ( ) => this . _invokeSentryModal ( ) ) ;
1212 }
1313
14- _invokeRavenModal ( ) {
15- Raven . showReportDialog ( {
14+ _invokeSentryModal ( ) {
15+ Sentry . showReportDialog ( {
1616 eventId : this . eventId
1717 } ) ;
1818 }
Original file line number Diff line number Diff line change 2525 "demo" : " gulp production"
2626 },
2727 "dependencies" : {
28+ "@sentry/browser" : " ^5.29.2" ,
2829 "bootstrap" : " ^3.3.6" ,
2930 "bootstrap-material-datetimepicker" : " https://github.com/T00rk/bootstrap-material-datetimepicker.git#gh-pages" ,
3031 "bootstrap-sass" : " ^3.4.1" ,
8990 "object-assign" : " 4.1.0" ,
9091 "open" : " 0.0.5" ,
9192 "pretty-hrtime" : " 1.0.2" ,
92- "raven-js" : " ^3.27.2" ,
9393 "require-dir" : " 1.2.0" ,
9494 "sinon" : " 1.17.4" ,
9595 "sinon-chai" : " 2.8.0" ,
Original file line number Diff line number Diff line change @@ -18,11 +18,9 @@ MarkupSafe~=1.0
1818mccabe ~= 0.6.1
1919oic ~= 0.11.0
2020psycopg2 ~= 2.8.5
21- pyldap ~= 2.4.45
2221pylint ~= 2.6.0
2322python-dateutil ~= 2.6.1
2423python-editor ~= 1.0.3
25- raven ~= 6.10.0
2624sentry-sdk [flask ]~= 0.19.5
2725six ~= 1.12.0
2826SQLAlchemy ~= 1.3.22
You can’t perform that action at this time.
0 commit comments