-
Notifications
You must be signed in to change notification settings - Fork 583
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
chore: enable sentry performance metrics #10720
Conversation
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.
This looks great!
Thank you for adding it to all NavigationContainer components! 👏👏👏
@@ -163,4 +164,5 @@ const InnerApp = () => ( | |||
</Providers> | |||
) | |||
|
|||
export const App = codePush(codePushOptions)(InnerApp) | |||
const SentryApp = Sentry.wrap(InnerApp) |
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.
possibly we should wrap the Main component rather than whole app 👀 double check. this may need to happen after setup is called
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.
this is recommended by the docs though: https://docs.sentry.io/platforms/react-native/tracing/instrumentation/automatic-instrumentation/
@@ -38,3 +39,5 @@ export const HomeContainer = () => { | |||
|
|||
return <HomeQueryRenderer /> | |||
} | |||
|
|||
export const HomeContainer = Sentry.withProfiler(InnerHomeContainer) |
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.
not 100% this is doing anything currently, double check, this should give us more react profile style metrics in home screen transactions, but I didn't see much of a difference before and after
* artwork in the home screen will fire as `screen:home` instead of `screen:artwork`. | ||
* To fix it we find the focused route and update the context name to the correct screen name. | ||
* This should be updated if we change our navigation setup. | ||
*/ |
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.
funkiness do to our nav set up, let me know if the comment makes sense, the good news is most screens fire and get registered as transactions but we need to update the names manually
@@ -17,7 +17,7 @@ if (__DEV__) { | |||
} catch {} | |||
} | |||
|
|||
require("./src/app/system/errorReporting/sentrySetup").setupSentry({ environment: "bootstrap" }) | |||
require("./src/app/system/errorReporting/setupSentry").setupSentry({ environment: "bootstrap" }) |
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.
I think we should probably remove this, I will do as separate pr to avoid too much in this one. I am guessing the intention was to initialize sentry early to catch errors early in app lifecycle, but I think we pay for it with complexity in our reporting having an extra env, and initializing 2x might be leading to subtler bugs in our reporting.
} else { | ||
toast.show("Sentry debugging disabled", "middle") | ||
} | ||
}, |
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.
since sentry set up is no longer in a hook because it needs to be earlier in the lifecycle, call it manually on change.
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.
I like the idea of the dev toggle to change env, thanks for adding that!
@@ -54,6 +55,14 @@ if (__DEV__) { | |||
|
|||
setupFlipper() | |||
|
|||
// Sentry must be setup early in the app lifecycle to hook into navigation | |||
const debugSentry = unsafe_getDevToggle("DTDebugSentry") |
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.
👏 gread idea adding a dev toggle
This PR resolves PHIRE-1142
Description
This enables support for starting to collect tracing data in sentry by hooking into our react navigation setup following the docs here.
You can see some metrics in our performance dashboard here.
Follow ups:
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.