getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

Integrate LeakCanary for production OOM/Leaks monitoring #3572

Open romtsn opened 4 months ago

romtsn commented 4 months ago

Description

LeakCanary has a whole section on how to integrate heap analysis with bugsnag https://square.github.io/leakcanary/leakcanary-for-releases/.

We could do something similar and either send a new event, or send the analysis as an attachment or context for OOM events (depending on how long the analysis takes).

This has to be a new integration, because of dependency on leakcanary.

There's also a bunch of recipes here: https://github.com/square/leakcanary/issues/2119

markushi commented 4 months ago

In the first iteration, let's roll with sending a custom event. At a later point we could think of doing the analysis right after an OOM happens (if possible).