wrapExpoRouter() in tracing/expoRouter.ts only wraps prefetch. The ExpoRouter interface already enumerates push, replace, back, navigate, but none of them are instrumented. As a result, programmatic navigations are invisible at the call-site level — we only see the resulting state change via the React Navigation listener, with no link back to the code that triggered it.
Wrap the other router methods so each navigation call:
- Adds a breadcrumb (
category: 'navigation', type: 'navigation') carrying the method (push / replace / navigate / back / dismiss), the target href, and the parsed pathname/params.
- Associates the call with the subsequent idle navigation transaction so the span can be attributed to the initiating method (e.g.
navigation.method = "push").
- Mirrors the existing prefetch error/status handling (
SPAN_STATUS_OK / SPAN_STATUS_ERROR).
- Is safe to call repeatedly — keep the
__sentryPrefetchWrapped guard pattern and extend it to a single __sentryWrapped flag.
wrapExpoRouter()intracing/expoRouter.tsonly wrapsprefetch. TheExpoRouterinterface already enumeratespush,replace,back,navigate, but none of them are instrumented. As a result, programmatic navigations are invisible at the call-site level — we only see the resulting state change via the React Navigation listener, with no link back to the code that triggered it.Wrap the other router methods so each navigation call:
category: 'navigation',type: 'navigation') carrying the method (push/replace/navigate/back/dismiss), the target href, and the parsed pathname/params.navigation.method = "push").SPAN_STATUS_OK/SPAN_STATUS_ERROR).__sentryPrefetchWrappedguard pattern and extend it to a single__sentryWrappedflag.