How errors are grouped/distinguished

ryan_m

Posted on
Jan 15 2015

How are errors groups/distinguished? Is it just based on the error message? What is two errors are reported with the same message, eg: "Data failed to load" but they had different stack traces. Would that be two error types or one?


John-Daniel Trask

Raygun

Posted on
Jan 15 2015

Hi Ryan,

Thanks for getting in touch. Grouping ranges from basic, to very sophisticated - it's part of our 'secret sauce' and something we're continually improving.

Here's an example:

You report an error, and we have the stack trace. We would look to group on several factors such as method names in the stack, classes involved, etc.

You report an error without a stack trace (or, a lousy stack trace like you'd get from old browsers for JS errors). We then need to fall back to Message based grouping.

To take it even further, we have unique grouping code for almost every language that we support as there is often specific things per platform that allow us to group better with.

In your scenario, if they had different stacks, and we know the stack traces from that platform are reliable, they would be two groups.

I hope that helps,

John-Daniel Trask


ryan_m

Posted on
Jan 15 2015

Thanks John - that sounds sufficient then.


jskrepnek

Posted on
Mar 12 2015

Hi John,

Do you recommend then that we keep contextual information out of error messages, so that in the case where the stack trace or some other signal cannot be used, then RayGun would still be able to successfully group by message?

Does RayGun used the exception type name to perform grouping? Ideally we could use specific exception names that have contextual messages and these would be grouped as the same error without having to lose helpful message details.

Thanks,

Joel


ryan_m

Posted on
Mar 12 2015

Yes we've been debating the same thing. If the error message is "Login error for user 123" that gets filed as a distinct error from "Login error for user 345". Would be nice to be able to provide some kind of optional error grouping key ("login_error_for_user"). I'd think this would be different from grouping based on the exception type, eg: NullReferenceException that could occur in many places that are really distinct errors.


John-Daniel Trask

Raygun

Posted on
Mar 16 2015

Hi Joel,

In general, I think it is best to keep contextual information out of exception messages. I know it's super easy to put it in, as a developer it does make life easier.

I've been thinking about this a lot over the last couple of years. I think my guidance on general good practices for exceptions is:

  1. Only throw them in exceptional circumstances.
  2. The message should be generic about the type of fault
  3. Leverage the platform features for context (e.g. in .NET, there is a Data dictionary attached to exception objects that you can load in context, Raygun picks this up).

Having said that, since we do group on stack if possible, even if the overall message is not generic, we will group them together. You can see the individual message in the instance data on the group page. Furthermore, you can edit the group title later to be generic (e.g. we have an error when a billing issue occurs from a library that we didn't write - it generates a very context heavy message, so we have renamed the group - which you can do on the group page with the pencil icon beside the main heading - so we know what's happened. We can then look at the instance data to see what the specifics were since that retains the original message).

The ability to send your own grouping key is in development at present.

I hope that helps!

John-Daniel Trask


suamikim

Posted on
Sep 22 2015

"The ability to send your own grouping key is in development at present."

Is this still true? I'm looking for such an option but can't find anything about custom/forced group keys in the javascript documentation.

I'd need this for the following scenario:

I'm receiving responses for many different requests from the server in an asynchronous manner. Since all those responses are basically handled (and passed on accordingly) in one place, they all have the same stack trace, when an error is recognized and handled there.

I already create meaningful (but still generic) error names from information within the erroneous response which I'd like to use for grouping inside raygun. Since raygun automatically groups by stack trace and ignores the error name many unrelated errors are collected in one big group which is pretty inconvenient for us.

I'd really appreciate if you could add an option to either ignore the stack trace for grouping or to force the group name. Since in general grouping by stack trace is very welcome, I'd like to set this option per sent error instance and not at initialization time.

Please let me know if I can expect something like this to come soon. Otherwise I'd have to look for some different solution/hack (remove or modify stack trace manually before sending if possible, ...).

Thanks & best regards


steve

Posted on
Oct 16 2015

We too would be very excited to take advantage of a "grouping key". It would give us some better control over alerts, possibly also satisfying a suggestion I made quite a while back to allow for some sort of custom alerting: https://raygun.io/thinktank/suggestion/10405

Is there a rough eta on its availability (weeks, months, etc..)?

Steve


suamikim

Posted on
Oct 21 2015

I'd really appreciate an response here.

Right now the automatic grouping by stack trace is making the error handling on raygun really cumbersome to us since most of our javascript errors are reported in the same group even though they have distinct error messages.

This makes the daily e-mail-reports & slack integration pretty much useless since we have to check every single reported error manually in the "backend" to know what it really was about.

Please give us at least an answer to the question of whether there is an option in development/planed or not.

Thanks


Jamie Penney

Posted on
Oct 22 2015

Hi,

We've got a big release planned for next week, so once that has calmed down I'll get the team to start working on this. It's going to take a while to add support for setting your own custom grouping key in all the client libraries we have, but we'll roll these out slowly as they're updated. All going to plan, we'll have this out before the end of the year.

Cheers,
Jamie


Reply