-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry: initialize on app start, and add utility for logging to it #1476
Conversation
src/index.js
Outdated
@@ -1,6 +1,9 @@ | |||
import 'core-js/stable' | |||
import 'regenerator-runtime/runtime' | |||
|
|||
// Initialize Sentry immediately if enabled | |||
import './sentry' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we feel like doing this is a bit sketchy / hidden? Would it be better if it were done directly in the index.js instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about exporting a initSentry()
function that would get called from here? Or is it to capture errors on import for react
, react-dom
and @aragon/ui
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, no good reason :).
I was going back and forth a couple times on it, but agree with you guys that mangling the global space on an import like this is probably less of a good idea.
if (process.env.NODE_ENV !== 'production') { | ||
if ( | ||
process.env.NODE_ENV !== 'production' && | ||
process.env.NODE_ENV !== 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a few tests (routing) that are causing the logger to emit statements during tests, so this turns them off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/index.js
Outdated
@@ -1,6 +1,9 @@ | |||
import 'core-js/stable' | |||
import 'regenerator-runtime/runtime' | |||
|
|||
// Initialize Sentry immediately if enabled | |||
import './sentry' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about exporting a initSentry()
function that would get called from here? Or is it to capture errors on import for react
, react-dom
and @aragon/ui
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same opinion as Pierre! (as discussed offline)
See #1457 (comment).
I didn't add the
SENTRY_DOMAIN
configuration yet, because I couldn't find an easy, obvious way to matchwindow.location.href
with a wildcard rule like*.aragon.org
(though certainly this must exist and be easy!).May need to be updated if #1475 is merged.