Grouping for Errors #929
Replies: 7 comments 11 replies
This comment has been hidden.
This comment has been hidden.
-
I think I just found another problem. We use a simple message when capturing errors in the - (SentryEvent *)buildErrorEvent:(NSError *)error
{
SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError];
SentryException *sentryException =
[[SentryException alloc] initWithValue:[NSString stringWithFormat:@"%ld", (long)error.code] type:error.domain];
event.exceptions = @[sentryException];
[self setUserInfo:error.userInfo withEvent:event];
return event;
} |
Beta Was this translation helpful? Give feedback.
-
We already agreed that The patch in the client could look something like this - (SentryEvent *)buildErrorEvent:(NSError *)error
{
SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError];
event.fingerprint = @[ error.domain,
[NSString stringWithFormat:@"%ld", (long)error.code]];
return event;
} |
Beta Was this translation helpful? Give feedback.
-
After reaching out to some customers and internal discussions, the decision is to use the exception interface with SDK fingerprinting for error domain and code. We don't add the stacktrace to the exception interface as it's generated by the SDK and not coming from the NSError, as NSErrors don't have stacktraces. Instead, we stay with the current approach of adding the stacktrace via the Merged PR is here #941 |
Beta Was this translation helpful? Give feedback.
-
Based on some conversations I would propose we try to avoid setting a fingerprint for now but achieve the same on the server. For that to work we are currently lacking information in the protocol. While we already set a lot of information in the mechanism for ns exceptions we don't yet have space for nserror Proposed protocol changes for {
"mechanism": {
"type": "NSError",
"ns_error": {
"domain": error.domain,
"code": error.code
}
}
} Since nothing sends this currently we can safely update the grouping algorithm on the server to take mechanism into account for |
Beta Was this translation helpful? Give feedback.
-
On the 28th of July, @untitaker raised concerns that the sentry-cocoa should send the stacktrace of an NSError on the exceptions interface instead of the current approach via
An internal discussion with @untitaker and @mitsuhiko came to the conclusion that we stick with the current approach and no further changes are necessary. |
Beta Was this translation helpful? Give feedback.
-
It looks like this is resolved, and in any case has been stale for a while, so will close this discussion. |
Beta Was this translation helpful? Give feedback.
-
@nburyak recently opened an issue #901, that Sentry groups errors with the same domain but different error code together. So
MyDomain 1
andMyDomain 2
end up in the same issue no matter the stacktraces, because grouping groups by message instead. This brought up a discussion if they shouldn't be two individual issues instead.The grouping algorithm doesn't consider errors with the same domain but different code as a reason to split up issues into different groups. The error code can stand for a different type of error on Apple even if the domain is the same. Therefore it makes sense to split up errors with the same domain but different code.
A way to achieve this manually is to use SDK Fingerprinting. Our docs even mention such a use case, but we didn't add the code sample for Apple yet. For sure, we should the code sample.
We could add an option, which is disabled by default as such a change would have a big impact on grouping, to set the fingerprint in the SDK and call something like this in SentryClient.buildErrorEvent:
The advantage would be that our users don't have to add SDK Fingerprinting manually in
beforeSend
. After gathering some feedback, we can discuss if we want to turn this feature on by default in 7.x.x.Beta Was this translation helpful? Give feedback.
All reactions