sentry-android-gradle-plugin icon indicating copy to clipboard operation
sentry-android-gradle-plugin copied to clipboard

Send modules along with SentryEvent

Open romtsn opened this issue 4 years ago • 5 comments
trafficstars

There's a capability in the Sentry product to display installed modules/dependencies, for instance, this is how it looks for Ruby image

Would be nice to do something similar for the Android SDK - we can collect the dependencies of an app through SAGP and make them available at runtime for the SDK, for example as a file under res/raw folder, and then the SDK can send it alongside protocol. This is already available in the protocol

romtsn avatar Nov 23 '21 14:11 romtsn

the AGP already generates a file with all the dependencies under a text file. it'd be nice if the SAGP picks this file up and make it available to the Sentry Android SDK, so we can send it at runtime.

pay attention that a big App could increase quite a lot the event size, could be that we exceed the 1MB max size.

do we want transitive dependencies or not?

an alternative for event size is using attachments.

this file could be under the resources/assets folder, so an event processor picks it up, loads it to memory, and attaches it to the events.

marandaneto avatar Dec 01 '21 15:12 marandaneto

the file is only available for release builds, so either we choose to send this only for release builds or we implement our own dependency gathering logic

romtsn avatar Dec 02 '21 07:12 romtsn

the file is only available for release builds, so either we choose to send this only for release builds or we implement our own dependency gathering logic

its fine to be only during release build.

marandaneto avatar Dec 02 '21 08:12 marandaneto

Just dropping my thoughts here: shouldn't the list of dependencies be uploaded at build time instead? Imho the list of deps should be uploaded alongside the proguard mapping and matched/displayed on the backend side. Uploading it at runtime adds unnecessary overhead for the user as you'll be essentially sending a static file over and over.

cortinico avatar Dec 02 '21 18:12 cortinico

@cortinico yes, that would be ideal, that would require changes on the backend tho. our protocol already supports it tho thru the event https://develop.sentry.dev/sdk/event-payloads/ via modules list. we'll keep that in mind, maybe could be done along with https://github.com/getsentry/sentry-android-gradle-plugin/issues/40

marandaneto avatar Dec 03 '21 09:12 marandaneto