sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Safe and production-ready to use in Android?

Open fzyzcjy opened this issue 4 years ago • 9 comments

Hi thanks for the lib! I wonder whether this lib is safe and production-ready to use in Android? More specifically:

  1. Will it crash (segfault, etc) once in a while? Because I see backtrace says that ... can lead this library to segfault ....
  2. Will the symbols be symbolized? Since https://github.com/rust-lang/rust/issues/17520 seems to be an open issue.
  3. Most importantly, are we ensured that the problems above never happen on every mobile phone (Android>=21 is acceptable)? In other words, if most of the phones work, but a small portion of phones crash or segfault, that is still terrible.

I am willing to use Sentry Rust but I have the worries above. Thanks for any suggestions!

Environment

How do you use Sentry? Sentry SaaS (sentry.io) or self-hosted/on-premise (which version?) saas

Which SDK and version? e.g: JavaScript 5.11.1, .NET 1.2.0 rust latest

Steps to Reproduce

n/a

Expected Result

n/a

Actual Result

n/a

fzyzcjy avatar Oct 13 '21 00:10 fzyzcjy

As you linked to basically two problems in the wider Rust ecosystem (also note that backtrace-rs is part of the rust stdlib), and I can’t really speak to those.

Otherwise I would say that this is safe to use, we use it server-side (though you asked for Android specifically), though it still has frequent breaking changes in the API.

Depending on what your goals are (capturing hard crashes, interaction with java), you might as well take a look at sentry-native or sentry-java (which bundles sentry-native for the NDK).

Swatinem avatar Oct 13 '21 07:10 Swatinem

My main goal is to capture anyhow::Result with a stack trace. My secondary goal is to see stack trace when a panic occurs. Thus, sentry-native/sentry-java has no use.

Is this Sentry-Rust used in Android and iOS environments before?

fzyzcjy avatar Oct 13 '21 07:10 fzyzcjy

Is this Sentry-Rust used in Android and iOS environments before?

Not that I know of.

Swatinem avatar Oct 13 '21 07:10 Swatinem

Ah......

fzyzcjy avatar Oct 13 '21 07:10 fzyzcjy

We have an app that uses Rust and Electron (using Sentry SDKs for both), and are using the Rust component in our Capacitor-based mobile app that we're developing. We're looking at using the Sentry Rust SDK there as well. Once we work on adding Sentry to the mobile app I'm happy to leave comments here regarding any issues we run into (as well as contribute fixes if possible)

rajivshah3 avatar Mar 28 '22 18:03 rajivshah3

@rajivshah3 By the way, I have successfully bundled sentry into my app in production (android + ios) and it seems to work well. Not see big issues up to now

fzyzcjy avatar Mar 28 '22 23:03 fzyzcjy

@fzyzcjy Do you have Sentry running on both sides (Kotlin & Rust)? Are spans, breadcrumbs, transactions shared between then?

audkar avatar Mar 29 '22 05:03 audkar

@audkar I use Sentry for flutter + rust and is communicated vis https://github.com/fzyzcjy/flutter_rust_bridge. None is shared.

fzyzcjy avatar Mar 29 '22 05:03 fzyzcjy

Sharing scope data between different language SDKs is always a challenge. So far, most of our Mobile focused SDKs that bundle sentry-native have implemented Scope-sync. Though nothing on the Rust side I know of.

Swatinem avatar Mar 29 '22 08:03 Swatinem