sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Expo Router performance auto instrumentation

Open krystofwoldrich opened this issue 2 years ago • 9 comments

Description

There is a new router for RN apps Expo Router, currently in RC.

  • https://expo.github.io/router/docs/

It's built on top of react-navigation so maybe auto instrumentation will work out of the box, but we need to check that.

krystofwoldrich avatar Jan 16 '23 11:01 krystofwoldrich

Maybe it works OOTB because its based on one of our integrations that we already support, likely has to be tested but in the case, offering 1st class support.

marandaneto avatar Jan 27 '23 13:01 marandaneto

Let's start by testing if it works OOTB and later prioritize again in case it does not work.

marandaneto avatar Jan 27 '23 13:01 marandaneto

Hi @krystofwoldrich do you have any update on this item? Dealing with this right now. Expo-router does not have a standard App.js entry point, so I'm trying to figure out if there is a workaround. Looks like I'm not alone: https://github.com/expo/sentry-expo/issues/370 Thanks

k1n8t1c avatar Dec 20 '23 23:12 k1n8t1c

Hey @k1n8t1c thanks for flagging this - we're already in the holiday slowdown, but expect updates after the holidays!

kahest avatar Dec 21 '23 08:12 kahest

Hey @krystofwoldrich please do update us on this issue. I'm working on an Expo project and would definitely appreciate an update on this.

prathmeshgodse avatar Jan 02 '24 03:01 prathmeshgodse

My team is also implementing sentry for Expo and we hit the same roadblock. Greatly appreciate for any help on this.

lavaxun avatar Jan 02 '24 09:01 lavaxun

Hey everyone, not sure if this is the preferred route, but in case it helps someone.

Working with expo router, I tried a couple of "hacks",

  • first, I wrapped the RootLayout element in our _layout.js before export- that did not enable instrumentation
  • then I followed this guide for enabling screen tracking in the expo router: https://docs.expo.dev/router/reference/screen-tracking/ combined with this guide https://docs.expo.dev/router/reference/screen-tracking/ This did the trick, at least for navigation events. Later, I might consider implementing custom instrumentation for the expo router if this issue is not resolved with expo router 3 and Expo 50.

k1n8t1c avatar Jan 03 '24 15:01 k1n8t1c

Thank you, everyone, for the messages and for letting us know about your interest, we are currently finalizing the deprecation of the sentry-expo library (https://github.com/getsentry/sentry-react-native/issues/3262).

And following that, we will work on new features like Expo Router Automatic Instrumentation.

krystofwoldrich avatar Jan 04 '24 10:01 krystofwoldrich

Todos:

  • [x] Add Guide to Sentry Docs (from https://docs.expo.dev/guides/using-sentry/#usage-with-expo-router)
  • [x] Enable the auto instrumentation in the Sentry Expo Sample application

krystofwoldrich avatar Jan 26 '24 22:01 krystofwoldrich

Docs are at https://docs.sentry.io/platforms/react-native/performance/instrumentation/expo-router/ Sample code here https://github.com/getsentry/sentry-react-native/blob/df6100af9c83e90d455c144985fd895d704516d5/samples/expo/app/_layout.tsx#L21-L23

krystofwoldrich avatar Jun 05 '24 07:06 krystofwoldrich