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

Synchronize `PropagationContext` across layers

Open krystofwoldrich opened this issue 1 year ago • 3 comments

Currently, WebViews, RN and native layers keep their own traceId. We could enhance the debugging experience by sharing trace across the hybrid applications layers.

Examples

  • RN opens WebView and an error (Browser SDK in WebView captured an error) happens on the web due to RN not supplying needed data (error was capture by RN). These are not sharing the same trace as the SDK operate independently.
  • Native SDK captures error, due to which data are missing in RN layer, and thus RN captures an error. Currently these errors are no covered by the same trace id.
### Tasks
- [ ] Pass trace from RN to native (if RN initialized first)
- [ ] React trace from native (if RN initialized second)
- [ ] Pass trace from RN to WebView
- [x] https://github.com/getsentry/sentry-java/pull/4137
- [x] https://github.com/getsentry/sentry-java/pull/4188
- [ ] https://github.com/getsentry/sentry-cocoa/pull/5081

krystofwoldrich avatar Jun 28 '24 11:06 krystofwoldrich

Example of WebView Trace Sync from a demo project.

  • https://github.com/krystofwoldrich/expo-dom-components/blob/main/lib/sentry/continueTrace.tsx

krystofwoldrich avatar Jun 04 '25 16:06 krystofwoldrich

Hi :D, is there a way to inject the traceId in the span context even if Sentry.continueSpan doesn't yet exist in @sentry/react-native? I would love to have insight into any problem that might arise when my front-end receive a message from my message queue!

Thanks, have a very good day!

noctisatrae avatar Jul 08 '25 19:07 noctisatrae

hi @noctisatrae thanks for the interest! We don't have an ETA yet, but it's in our backlog to provide an API for that @antonis fyi

stefanosiano avatar Jul 10 '25 14:07 stefanosiano