[
https://issues.apache.org/jira/browse/CASSANDRA-20858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18017657#comment-18017657
]
Stefan Miklosovic edited comment on CASSANDRA-20858 at 9/2/25 12:41 PM:
------------------------------------------------------------------------
[~paulo] do you want keep the track of exceptions which are of same class? If
we get 100 FsErrors, you want to see them all? What I am currently doing is
that I am "merging them" into one and just increasing the counter. That is how
I understand what you suggested when this ticket was created but then you are
also proposing the static column etc. I think that if we want to have it more
unique while still deduplicating, we should do that based on where that
exception was thrown (exact line number), that is possible to get from the
stacktrace.
So if you had IllegalStateException thrown at place A in the code and place B
in the code, while it is still same exception type, they differ on the place in
the code they were thrown at and they might be completely different, logically
wise, from each other.
With your suggestion of {{primary key (class, time)}} primary key, you would
just see them ordered by time, but you would not easily recognize one from
another if two of the same type are thrown at different places.
What I currently have is that one would "shadow" another one, just with the
counter increased.
This is what I am proposing instead
{code:java}
CREATE TABLE exceptions (
exception_class text,
thrown_at text,
count int,
last_occurence timestamp,
last_message text
last_stacktrace list<text>,
primary (exception_class, thrown_at, last_message)
) {code}
We do not need to have "count" static. We will just increase it as we gather
same {{exception_class}} and {{thrown_at}}.
You can do
{code}
select * from exceptions where exception_class = 'IllegalStateException'
{code}
{code}
select * from exceptions where exception_class = 'IllegalStateException' and
thrown_at = 'SomeClass.java:55'
{code}
{code}
select * from exceptions where exception_class = 'IllegalStateException' and
thrown_at = 'SomeClass.java:55' and last_message = 'Something went wrong';
{code}
was (Author: smiklosovic):
[~paulo] do you want keep the track of exceptions which are of same class? If
we get 100 FsErrors, you want to see them all? What I am currently doing is
that I am "merging them" into one and just increasing the counter. That is how
I understand what you suggested when this ticket was created but then you are
also proposing the static column etc. I think that if we want to have it more
unique while still deduplicating, we should do that based on where that
exception was thrown (exact line number), that is possible to get from the
stacktrace.
So if you had IllegalStateException thrown at place A in the code and place B
in the code, while it is still same exception type, they differ on the place in
the code they were thrown at and they might be completely different, logically
wise, from each other.
With your suggestion of {{primary key (class, time)}} primary key, you would
just see them ordered by time, but you would not easily recognize one from
another if two of the same type are thrown at different places.
What I currently have is that one would "shadow" another one, just with the
counter increased.
This is what I am proposing instead
{code:java}
CREATE TABLE exceptions (
exception_class text,
thrown_at text,
count int,
last_occurence timestamp,
last_message text
last_stacktrace list<text>,
primary (exception_class, thrown_at, last_message)
) {code}
We do not need to have "count" static. We will just increase it as we gather
same {{exception_class}} and {{thrown_at}}.
You can do
{code}
select * from exceptions where exception_class = 'IllegalStateException'
{code}
{code}
select * from exceptions where exception_class = 'IllegalStateException' and
thrown_at = 'SomeClass.java:55'
{code}
{code}
select * from exceptions where exception_class = 'IllegalStateException' and
thrown_at = 'SomeClass.java:55' and last_message = 'Some went wrong';
{code}
> Add virtual table to expose last N uncaught exceptions
> ------------------------------------------------------
>
> Key: CASSANDRA-20858
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20858
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Virtual Tables
> Reporter: Paulo Motta
> Assignee: Stefan Miklosovic
> Priority: Normal
> Fix For: 5.0.x, 5.x
>
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> There's a metric {{StorageMetrics.uncaughtExceptions}} that tracks uncaught
> exception count.
> Let's add a {{system_views.exceptions}} table with the following information:
> * ExceptionClass
> * Count
> * Last Message
> * Last StackTrace
> * Last Occurence Time
> This will give more visibility into uncaught exceptions allowing operators to
> easily find unexpected issues that can be hidden in logs.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]