Skip to content

Group exceptions/messages - #30

Closed
ColinHebert wants to merge 2 commits into
getsentry:refactoringfrom
ColinHebert:grouping
Closed

ColinHebert wants to merge 2 commits into
getsentry:refactoringfrom
ColinHebert:grouping

Conversation

@ColinHebert

Copy link
Copy Markdown

This is a follow-up for #28:

Exceptions in log4j are now grouped by stacktrace content which should be more relevant than exception messages
Simple logs in log4j are grouped by locationInformation (line where the log was done) if available, message content otherwise.


This is a quick and dirty fix, for the issue #28 and may require more thoughts, but still it works nicely.

@dcramer

dcramer commented Dec 12, 2012

Copy link
Copy Markdown
Member

22 days behind here, but we can probably just remove checksums altogether.

Most of the clients now leave it up to the server (which IMO is ideal) to generate the checksum in the best way possible.

@ColinHebert

Copy link
Copy Markdown
Author

I'm not so sure that the default checksum would be great. In Java exception messages tend to contain some details about the exception itself, this means that for one unique exception you can end up with different checksums.

Generating the checksum manually on the other hand allows to ensure that two exceptions with the same stacktrace have the same checksum. Whether the message is the same or not.
And if a stacktrace isn't available sentry couldn't possibly generate a same checksum for two different messages logged at the exact same place. The code in this pull request can.

I think that leaving the checksum generation to the server is useful only when your log messages are always strictly the same, this is not the case in Java at all.

Colin Hebert added 2 commits February 4, 2013 13:26
Default on the message if the checksumContent isn't provided
Exceptions are now grouped by stacktrace content which should be more
relevant than exception messages
Simple logs are grouped by locationInformation (line where the log was done)
if available, message otherwise.
@ColinHebert

Copy link
Copy Markdown
Author

Rebased the commits on the latest version of refactoring (If you remove the refactoring branch, I'll reopen a pull request on master)

@buckett

buckett commented Mar 20, 2013

Copy link
Copy Markdown
Contributor

Would allowing this as an option be a good solution?

@buckett

buckett commented Mar 20, 2013

Copy link
Copy Markdown
Contributor

Just to make it clear the stack trace includes the message. Here is an example:

Caused by: java.net.URISyntaxException ("Illegal character in path at index 87: http://my.url.with/a/ (space)") at line -1
java.net.URI$Parser in fail at line 2825
java.net.URI$Parser in checkChars at line 2998
java.net.URI$Parser in parseHierarchical at line 3082
[...snipped...]

This means that you end up with a separate checksum for each URI that fails in this example even if the stack trace is the same. You can't sensibly do this on the server as by that point it's not simple to separate the message from the rest of the stack trace as it all comes across in one field.

@ColinHebert

Copy link
Copy Markdown
Author

Not really, only the stackframes are used (classname, method, line), not the name of the exception nor the message, see here

@buckett

buckett commented Mar 20, 2013

Copy link
Copy Markdown
Contributor

In the patch only the frames are used but attempting todo stacktrace checksuming on the server means you have to be able to strip off the message, because by then the stacktrace and the message are merged.

@dcramer

dcramer commented Mar 20, 2013

Copy link
Copy Markdown
Member

Realistically the message should not be part of the stacktrace, but it seems that it ends up there.

As long as that's not true, then the server will correctly handle sanitizing the stacktrace and doing the checksum correctly.

@roam

roam commented Mar 20, 2013

Copy link
Copy Markdown

Guys, thanks for the input. I haven't had a close look at the code, but I'm guessing the remaining problems could be resolved if we can clear out issue #43.

Whether the ability to calculate your own checksum is absolutely crucial... I don't know. Maybe it would be useful for logging levels other than error. E.g. logger.warn("Could not log on"), but you'll probably be including some other information in the message as well, like the username.

@ColinHebert if you could rebase this on master, that would be great.

@ColinHebert

Copy link
Copy Markdown
Author

hum, I'll have to open a new pull request I suppose as this pull request is made for the refactoring branch: See #44

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.

4 participants