-
Notifications
You must be signed in to change notification settings - Fork 86
Sentry shouldn't group unrelated errors together #2288
Comments
@jarifibrahim thank you for putting this list together. It is really good that you've looked into the issue. Can you elaborate on how option 1 would solve the problem please? As a side note: I did hear from @aslakknutsen that some UI folks had the exact opposite problem that we have. They had too many sentry issues for the same problem in code. @aslakknutsen handed me this reference to what they did in order to address the problem: https://github.com/fabric8-ui/fabric8-ui/blob/fc37a478011d5190a42656ef0b01059e70336924/src/app/shared/exception.handler.ts#L47-L75 |
@kwk I am still investigating how we could do this. https://github.com/getsentry/raven-go doesn't have much documentation about interfaces or how to use them correctly and it looks like it might take some time for the documentation to be updated (see getsentry/raven-go#205) Meanwhile I looked into why those errors on sentry do not have a proper stacktrace and it turns out that the |
@jarifibrahim that is well understood but the question is where we are not wrapping standard errors with |
@kwk The problem starts here. This uses the standard golang error which has only string inside it. No stack information Lines 101 to 105 in fce0b6a
|
@jarifibrahim that is not correct. The standard golang error is a just an interface with no information connected. Therefore the The implementation of If we implement the internal type causer interface {
Cause() error
} |
According to https://docs.sentry.io/learn/rollups/#grouping-by-stacktrace page, all errors going to sentry are grouped according to
stacktrace (if present)
. The doc saysMost of the errors thrown from the backend contain this minimal stacktrace
due to
fabric8-wit/sentry/sentry.go
Line 101 in 59561d0
Since all events have similar stacktrace they are all grouped together into one issue and it makes it very difficult to search for errors. Look at https://errortracking.prod-preview.openshift.io/openshift_io/fabric8-wit/issues/2083/events/ .
It contains errors like
This can be fixed by either one of the following
Improving the sentry client to use interface (interface) so that the events can be distinguished - This one seems to be the most feasible option and it would require minimal effort.
Refactoring all errors so that instead of just returning the errors from the controller we return error along with the stacktrace using
errs.WithStack(....)
- I don't think we want this because it doesn't make sense to return the entire stacktrace to the user.Moving the sentry logging out of the
jsonapi.JSONErrorResponse()
into each controller so that every error can be logged/handled separately - This might solve the problem but this would mean we have to addsentryClient.CaptureError(...)
to all error handling block. This doesn't seem feasible to me.Removing stacktrace from the error if it didn't have one originally - The sentry client somehow captures these two calls in the stacktrace
if we could get rid of these then all the errors would be grouped according to the error message which would make much more sense.
I think option 1 would be the best way because it would allow us to send custom data (like controller name) to sentry.
What do you think @kwk @xcoulon @aslakknutsen ?
The text was updated successfully, but these errors were encountered: