Enhanced Error Grouping for React Native Sentry Integration
Overview
I propose an enhancement for the sentry-react-native SDK, specifically targeting the error grouping mechanism. Currently, Sentry groups errors primarily based on stack traces. However, in a React Native environment, different types of errors (like network failures, UI glitches, etc.) can sometimes have similar stack traces, leading to less effective grouping. I suggest implementing an additional grouping layer based on error context or type.
Suggested Feature
Implement an additional error grouping mechanism in the sentry-react-native SDK that categorizes errors not only by stack traces but also by error types or contexts. This could include UI errors, network errors, or custom error types defined by the developer.
Expected Behavior
With this enhancement, the Sentry dashboard would show more distinct and contextually grouped errors. This grouping would allow developers to more efficiently identify and address different types of issues in their React Native applications.
Use Case Scenario
Consider a React Native app with both network request failures and UI rendering issues. Even if these problems result in similar stack traces, the proposed feature would distinguish them in the Sentry dashboard, enabling quicker identification and resolution of these distinct issues.
Environment
- RN Version: 0.66
- Sentry RN Version: 3.2.1
- Platform: iOS, Android
- Device info (Simulator/Device? OS version? Debug/Release?): Android Simulator, Android 11, Debug
Additional Context
This enhancement could significantly improve the developer experience, especially in complex React Native applications where different types of errors may be intertwined. It aligns with Sentry's goal of providing clear, actionable insights into application performance and stability.
Looking forward to feedback and thoughts on this proposal.
Hey @jo-arciniegas, thanks a lot for the detailed and thoughtful proposal! We will definitely discuss this and follow up here (I also may convert this to a discussion later).
Do you have links to example events that show the undesired behavior you're describing? That would greatly help us understand the use case and how the grouping in these situations is applied. If you don't feel comfortable sharing the links here, you can also send them to [email protected] if that's ok for you.
Thanks again!
Let's check if the error message creates a new issue group.
HTTP Client Errors grouping (does a different URL create a new group)?
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 remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Wondering if this could extend to all events, not just exceptions, i.e. captureEvent / captureMessage?
It relates to another issue where we would like some control over the grouping at the implementation level:
https://github.com/getsentry/sentry-react-native/issues/3530
Let's check if the error message creates a new issue group.
HTTP Client Errors grouping (does a different URL create a new group)?
Following up on my previous message, the grouping depends on the patterns we detect in the event. For example, if an error message changes only in the object ID, we group them.
So depending on the URL, they might be grouped more than expected. We offer options to have more granular options to fine-tune the grouping, see the following links:
- https://docs.sentry.io/platforms/react-native/usage/sdk-fingerprinting/
- https://docs.sentry.io/product/data-management-settings/event-grouping/fingerprint-rules/
As mentioned in https://github.com/getsentry/sentry-react-native/issues/3452#issuecomment-1904473372 we offer customization of the default grouping to adjust Sentry to your application needs.
If there is any concrete case where the current solution doesn't work, please feel free to comment here or open a new issue with the new details.