Skip to content
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

refactor:[IOPLT-978] Changes the Sentry integration for performance monitoring #6741

Merged
merged 4 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions ts/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export type ReactNavigationInstrumentation = ReturnType<
typeof Sentry.reactNavigationIntegration
>;

export const navigationIntegration = Sentry.reactNavigationIntegration({
enableTimeToInitialDisplay: true
});

const removeUserFromEvent = <T extends ErrorEvent | TransactionEvent>(
event: T
): T => {
Expand All @@ -48,11 +44,14 @@ Sentry.init({
return removeUserFromEvent(event);
},
ignoreErrors: ["HTTPClientError"],
integrations: integrations => [...integrations, navigationIntegration],
integrations: integrations => [
...integrations,
Sentry.reactNativeTracingIntegration()
],
enabled: !isDevEnv,
// https://sentry.zendesk.com/hc/en-us/articles/23337524872987-Why-is-the-the-message-in-my-error-being-truncated
// https://sentry.zendesk.com/hc/en-us/articles/23337524872987-Why-is-the-message-in-my-error-being-truncated
maxValueLength: 3000,
tracesSampleRate: 0.3,
tracesSampleRate: 0.2,
sampleRate: 0.3
});

Expand All @@ -75,9 +74,7 @@ const App = (): JSX.Element => (
<BottomSheetModalProvider>
<LightModalProvider>
<StatusMessages>
<RootContainer
routingInstumentation={navigationIntegration}
/>
<RootContainer />
</StatusMessages>
</LightModalProvider>
</BottomSheetModalProvider>
Expand Down
10 changes: 2 additions & 8 deletions ts/RootContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ import {
} from "./store/reducers/persistedPreferences";
import { GlobalState } from "./store/reducers/types";
import customVariables from "./theme/variables";
import { ReactNavigationInstrumentation } from "./App";
import { setScreenReaderEnabled } from "./store/actions/preferences";

type Props = ReturnType<typeof mapStateToProps> &
typeof mapDispatchToProps & {
routingInstumentation: ReactNavigationInstrumentation;
};
type Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;

/**
* The main container of the application with:
Expand Down Expand Up @@ -118,9 +114,7 @@ class RootContainer extends PureComponent<Props> {
backgroundColor={customVariables.androidStatusBarColor}
/>

<IONavigationContainer
routingInstrumentation={this.props.routingInstumentation}
/>
<IONavigationContainer />

{/* When debug mode is enabled, the following information
is displayed:
Expand Down
2 changes: 1 addition & 1 deletion ts/navigation/AppStackNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const InnerNavigationContainer = (props: InnerNavigationContainerProps) => {
export const IONavigationContainer = ({
routingInstrumentation
}: {
routingInstrumentation: ReactNavigationInstrumentation;
routingInstrumentation?: ReactNavigationInstrumentation;
}) => (
<InnerNavigationContainer routingInstrumentation={routingInstrumentation}>
<AppStackNavigator />
Expand Down
Loading