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

Several Stacktraces can ignored when an event was reported

Open km-jiaxiu opened this issue 1 year ago • 5 comments

We made our own delegate to report the Android platform's assertions,But the top couple of Stacktraces we don't want to report,or that's what happens:we want the "UEngine:PerformError" to be top so that the title is displayed correctly. Otherwise all assertions are displayed “SentrySubsystemAndroid::OnCrashing” ,[Issue Grouping]--[FINGERPRINT RULES]--[stack.*] only get the top stack so i cannot make a correctly title image Or is there another way to solve this problem? thanks~

km-jiaxiu avatar Jan 30 '24 08:01 km-jiaxiu

@km-jiaxiu I don't think you can alter the stack trace of the event being captured by native SDK on Android. Can you elaborate on what that delegate you've mentioned above is responsible for and how exactly it works?

tustanivsky avatar Jan 30 '24 18:01 tustanivsky

@km-jiaxiu I don't think you can alter the stack trace of the event being captured by native SDK on Android. Can you elaborate on what that delegate you've mentioned above is responsible for and how exactly it works?

SentrySubsystemAndroid.cpp :

  1. add the code: FCoreDelegates::OnHandleSystemError.AddRaw(this, &SentrySubsystemAndroid::OnCrashing); to the InitWithSettings Function
  2. Add a function to the SentrySubsystemAndroid class:void SentrySubsystemAndroid::OnCrashing() { *(int32 *)3 = 123; }
  3. Set Configuration to Development, Package Android, Launch the App, Input command: debug check

km-jiaxiu avatar Jan 31 '24 03:01 km-jiaxiu

We want to invoke the function in Unreal which in the class io.sentry.SentryEvent , so that we can remove stacktraces we do not need before send. image

km-jiaxiu avatar Jan 31 '24 03:01 km-jiaxiu

If you want to modify the event before it gets sent you can take a look at the beforeSend callback. We've got an example here https://github.com/getsentry/sentry-unreal/blob/6f2eaabf88e8594202af2547c04d81f1807a74e1/sample/Source/SentryPlayground/CppBeforeSendHandler.cpp#L8

bitsandfoxes avatar Feb 06 '24 11:02 bitsandfoxes

@km-jiaxiu We've managed to resolve this issue in #537. The fix should be available with the next plugin release or you can try to download the corresponding package from our GitHub CI here.

tustanivsky avatar May 21 '24 09:05 tustanivsky