sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Enhanced Error Grouping for React Native Sentry Integration

Open asimlab opened this issue 2 years ago • 6 comments

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.

asimlab avatar Dec 06 '23 18:12 asimlab

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!

kahest avatar Dec 07 '23 09:12 kahest

Let's check if the error message creates a new issue group.

HTTP Client Errors grouping (does a different URL create a new group)?

krystofwoldrich avatar Dec 15 '23 13:12 krystofwoldrich

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 🥀

getsantry[bot] avatar Jan 06 '24 08:01 getsantry[bot]

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

adbs1 avatar Jan 21 '24 21:01 adbs1

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/

krystofwoldrich avatar Jan 22 '24 17:01 krystofwoldrich

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.

krystofwoldrich avatar Mar 08 '24 14:03 krystofwoldrich