Issue Ownership
Platform
iOS
Installed
CocoaPods
Version
7.24.1
Steps to Reproduce
- Create a new Framework and have a crash func inside it
- use this package from an example app and call the func to crash the app
- create an issue onwnership on the dashboard using type
module: FRAMEWORK_NAMEand assign it to member/team
Expected Result
the crash should be suggested or assigned to the member/team
Actual Result
this is not happening because
Sentry on Dashboard is using stacktracke.module values for the issue ownership rule module but the reported stack from the iOS SDK is Ignoring the SentryFrame.module and only sends SentryFrame.package
https://github.com/getsentry/sentry-cocoa/blob/2168cdc3bd2dbbe520316513015af1fb547c9bfc/Sources/Sentry/Public/SentryFrame.h#L25-L34
Thanks for pointing that out, @embassem. While we could start sending module, I first have to check what implications that would trigger.
I need to clarify the exact difference between module and package, as our develop docs https://develop.sentry.dev/sdk/event-payloads/stacktrace/ don't give me a clear answer.
The Android SDK sends module, but not package. Same for the Python SDK. Maybe the solution is also that issue ownership would work with package as well. Currently, it only supports module, path, URL, and tag, see https://docs.sentry.io/product/issues/issue-owners/. I will clarify that and get back to you.
For reference, internal Slack discussion.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
The SDK uses the imageName as package. The imageName contains the full path to the image, such as
- "/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore"
- "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
- "/private/var/containers/Bundle/Application/ED1CA0BB-A6D4-45AB-9232-9EE2802D9C7F/iOS-Swift.app/iOS-Swift"
Although the SDK sends the full path to Sentry, the JSON payload in Sentry only contains the last path components, such as UIKitCore, or iOS-Swift. So we strip the path somewhere in Sentry.
I think we could start sending module with the same value, which Sentry doesn't strip. So it would be the whole image path, which would align with our develop docs: Platform-specific module path (e.g. sentry.interfaces.Stacktrace).
Unfortunately, setting SentryFrame.module impacts grouping; see docs and screenshot:
I have to validate if we can make some changes on the backend to make this a nonbreaking change. Even if we do this in a major bump, it'd be highly annoying to users as every issue grouped by stacktrace would end up in a new group.
Git Diff for setting `SentryFrame.module`
diff --git a/Sources/Sentry/SentryCrashReportConverter.m b/Sources/Sentry/SentryCrashReportConverter.m
index d6672fad..65a3ae51 100644
--- a/Sources/Sentry/SentryCrashReportConverter.m
+++ b/Sources/Sentry/SentryCrashReportConverter.m
@@ -264,6 +264,7 @@ - (SentryFrame *)stackFrameAtIndex:(NSInteger)frameIndex inThreadIndex:(NSIntege
frame.instructionAddress = sentry_formatHexAddress(frameDictionary[@"instruction_addr"]);
frame.imageAddress = sentry_formatHexAddress(binaryImage[@"image_addr"]);
frame.package = binaryImage[@"name"];
+ frame.module = [binaryImage[@"name"] lastPathComponent];
BOOL isInApp = [self.inAppLogic isInApp:binaryImage[@"name"]];
frame.inApp = @(isInApp);
if (frameDictionary[@"symbol_name"]) {
diff --git a/Sources/Sentry/SentryCrashStackEntryMapper.m b/Sources/Sentry/SentryCrashStackEntryMapper.m
index 4937146f..c92bfa33 100644
--- a/Sources/Sentry/SentryCrashStackEntryMapper.m
+++ b/Sources/Sentry/SentryCrashStackEntryMapper.m
@@ -45,6 +45,7 @@ - (SentryFrame *)sentryCrashStackEntryToSentryFrame:(SentryCrashStackEntry)stack
NSString *imageName = [NSString stringWithCString:stackEntry.imageName
encoding:NSUTF8StringEncoding];
frame.package = imageName;
+ frame.module = [imageName lastPathComponent];
frame.inApp = @([self.inAppLogic isInApp:imageName]);
}
diff --git a/Sources/Sentry/SentryMetricKitIntegration.m b/Sources/Sentry/SentryMetricKitIntegration.m
index df637276..3d2b67ec 100644
--- a/Sources/Sentry/SentryMetricKitIntegration.m
+++ b/Sources/Sentry/SentryMetricKitIntegration.m
@@ -271,6 +271,7 @@ - (SentryStacktrace *)convertMXFramesToSentryStacktrace:(NSEnumerator<SentryMXFr
for (SentryMXFrame *mxFrame in mxFrames) {
SentryFrame *frame = [[SentryFrame alloc] init];
frame.package = mxFrame.binaryName;
+ frame.module = [mxFrame.binaryName lastPathComponent];
frame.instructionAddress = sentry_formatHexAddress(@(mxFrame.address));
NSNumber *imageAddress = @(mxFrame.address - mxFrame.offsetIntoBinaryTextSegment);
frame.imageAddress = sentry_formatHexAddress(imageAddress);
Unfortunately, setting
SentryFrame.moduleimpacts grouping;
I believe is high unlikely that issues created by different modules have the same stacktrace, so they will end up in a new group anyway.
@brustolin, have a look at https://sentry-sdks.sentry.io/issues/?project=5428557&query=is%3Aunresolved+captured+a+message&referrer=issue-list&statsPeriod=14d.
Existing Grouping
https://sentry-sdks.sentry.io/issues/2895893229/events/b3a2e3a1132c43a6a5fefe8dd9e58171/?project=5428557

New Group 1
https://sentry-sdks.sentry.io/issues/3963189205/events/1c3b5d72e9004849b54ba3a7128eb5b0/?project=5428557

New Group 2
https://sentry-sdks.sentry.io/issues/3963200633/events/a9bebe6f64da4a2ab31968d46d4d1ef4/?project=5428557

You mean, errors will change from one group to another when we add modules, but then the groups will be consistent in the new rule?
IMO this is not a problem.
IMO this is not a problem.
It will trigger tons of alerts, and the same issues will end up in different groups depending on the Cocoa SDK version. That's why it's a problem.
This will happen for a week, maybe a little more while every user update their apps, and then wont happen anymore, and the dev will start to have the module in the event.
I would gladly accept this tradeoff as an app developer.
@embassem, until we support module for issue ownership, you should be able to paths, as the SDK sends these, see https://docs.sentry.io/product/issues/issue-owners/#methods.
Hello @philipphofmann, this is what we have in our setup for now, we are using paths.
@embassem, is it working correctly for you? Anything we can improve?
I'm gonna close this now as it is stale. Please let us know if this is still relevant for you.