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

Improve inApp by default on Android

Open marandaneto opened this issue 4 years ago • 9 comments

https://github.com/getsentry/sentry-java/blob/main/sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java#L173-L177

what's about adding the first 2 or 3 parts of the App's package as inApp by default?

eg, App's package (3 parts): io.sentry.mobile.android

frames like io.sentry.mobile.shared won't be marked as inApp unless they add inAppIncludes manually, which is suboptimal. the idea would be to split it and take the very first 3 packages io.sentry.mobile.*

eg, App's package (2 parts): io.sentry.android.mobile

frames like io.sentry.shared.android won't be marked as inApp. the idea would be to split it and take the very first 2 packages io.sentry.*

it's a common pattern to have the company's domain in the very first 2 parts, so it'd not lead to that much false positive, but this would affect grouping and it'd require a major bump, I guess.

what do you think?

marandaneto avatar Mar 15 '21 10:03 marandaneto

another option way less aggressive would be to be explicit about that on our docs and wizard, adding examples of that in the SDK setup instead of hidden in the config. options

marandaneto avatar Mar 15 '21 11:03 marandaneto

@marandaneto It's a great idea to add it by default. We could add the first three levels:

I.e: App: io.sentry.app We add: io.sentry.app

If the app is: br.com.mycompany.myapp it would end up br.com.mycompany

bruno-garcia avatar Mar 15 '21 16:03 bruno-garcia

depends on https://github.com/getsentry/sentry-native/pull/514

marandaneto avatar Apr 15 '21 12:04 marandaneto

Let's cap at 3 levels at a minimum, otherwise, go one level less, e.g. br.com.mycompany keeps as it is, br.com.mycompany.android becomes br.com.mycompany.

marandaneto avatar Jan 17 '22 14:01 marandaneto

Let's investigate if this is possible via the Gradle plugin before going ahead, we might be able to have the full list of package names and pass this to the SDK init., it'd be more accurate.

marandaneto avatar Jan 17 '22 14:01 marandaneto

We want to use the Sentry Android Gradle Plugin to get the full list of packages and add them to inAppIncludes.

philipphofmann avatar Apr 27 '22 14:04 philipphofmann

According to @untitaker it's not a breaking change

bruno-garcia avatar Apr 27 '22 14:04 bruno-garcia

Profiling is doing this server-side (for profiling specifically), align with them and @stefanosiano about how to do this.

marandaneto avatar May 22 '23 07:05 marandaneto

Ideally we need some handling for this on the backend for obfuscated builds. Let's also make sure we handle basic cases right and e.g. do not mark com.* as in-app.

markushi avatar Aug 09 '23 13:08 markushi