Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(processing): Only mark aggregate errors as exception groups #10850

Merged

Conversation

lobsterkatie
Copy link
Member

When Sentry started supporting the idea of exception groups, two changes happened. In the SDK, we adapted our logic for handling linked errors to also handle AggregateErrors. And in our ingest pipeline, we began looking for an is_exception_group flag on the last entry in `event.exception.values; when we found it, we'd then ignore that entry when grouping and titling events, under the assumption that it was just a container and therefore wasn't meaningful.

When it came to instances of AggregateError, this worked great. For linked errors, however, this caused us to focus on the cause error rather than the error which was actually caught, with the result that it both threw off grouping and made for some very unhelpful titling of issues. (See the screenshot below, in which the first three errors are, respectively, an UndefinedResponseBodyError, a RequestError, and an InternalServerError, though you'd be hard pressed to figure that out without opening them up.)

This fixes those problems by restricting the use of the is_exception_group flag to AggregateErrors.

Note: In order to update the tests to work with this change, I had add in consideration of the error name property and the corresponding event type property, to match what we do in real life. To keep things readable, there's a new mock AggregateError class, which I adapted all the tests to use.

Fixes getsentry/sentry#59679.

These issues all look the same, but they are not, in fact, the same
image

Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.19 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.44 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.36 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 61.99 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.66 KB (+0.04% 🔺)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 32.66 KB (+0.04% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 30.83 KB (+0.05% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 30.83 KB (+0.05% 🔺)
@sentry/browser - Webpack (gzipped) 22.11 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.6 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.28 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.11 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.6 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 210.77 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 99.49 KB (+0.04% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.67 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.18 KB (+0.05% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.72 KB (+0.02% 🔺)
@sentry/react - Webpack (gzipped) 22.13 KB (+0.07% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.2 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.53 KB (+0.03% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.03 KB (0%)

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Katie!

I'll take care of backporting this onto v7.

@AbhiPrasad AbhiPrasad merged commit 006b096 into develop Feb 29, 2024
97 checks passed
@AbhiPrasad AbhiPrasad deleted the kmclb-stop-considering-linked-errors-exception-groups branch February 29, 2024 15:42
AbhiPrasad pushed a commit that referenced this pull request Feb 29, 2024
When Sentry started supporting the idea of exception groups, two changes
happened. In the SDK, we adapted our logic for handling linked errors to
also handle `AggregateError`s. And in our ingest pipeline, we began
looking for an `is_exception_group` flag on the last entry in
`event.exception.values; when we found it, we'd then ignore that entry
when grouping and titling events, under the assumption that it was just
a container and therefore wasn't meaningful.

When it came to instances of `AggregateError`, this worked great. For
linked errors, however, this caused us to focus on the `cause` error
rather than the error which was actually caught, with the result that it
both threw off grouping and made for some very unhelpful titling of
issues. (See the screenshot below, in which the first three errors are,
respectively, an `UndefinedResponseBodyError`, a `RequestError`, and an
`InternalServerError`, though you'd be hard pressed to figure that out
without opening them up.)

This fixes those problems by restricting the use of the
`is_exception_group` flag to `AggregateError`s.

Note: In order to update the tests to work with this change, I had add
in consideration of the error `name` property and the corresponding
event `type` property, to match what we do in real life. To keep things
readable, there's a new mock `AggregateError` class, which I adapted all
the tests to use.
@lobsterkatie
Copy link
Member Author

I'll take care of backporting this onto v7.

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linked exceptions and which is used for grouping?
2 participants