You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Stefan Miklosovic (Jira)" <ji...@apache.org> on 2022/10/05 15:15:00 UTC

[jira] [Commented] (CASSANDRA-17948) Get warning and errors through virtual tables

    [ https://issues.apache.org/jira/browse/CASSANDRA-17948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613038#comment-17613038 ] 

Stefan Miklosovic commented on CASSANDRA-17948:
-----------------------------------------------

Interesting idea. I put this together as proof of concept (1). Basically, we implement an appender  which will put log messages into some kind of a structure (map so far) and it will display the logs on request. For example:

 
{code:java}
cqlsh> expand on;
cqlsh> select * from system_views.instance_logs limit 5;

@ Row 1
-----------+--------------------------------------------
 timestamp | 1664982569815
 level     | INFO
 message   | Creating replication strategy system_auth params KeyspaceParams{durable_writes=true, replication=ReplicationParams{class=org.apache.cassandra.locator.SimpleStrategy, replication_factor=1}}

@ Row 2
-----------+--------------------------------------------
 timestamp | 1664982569816
 level     | INFO
 message   | Initializing system_auth.network_permissions

@ Row 3
-----------+--------------------------------------------
 timestamp | 1664982569823
 level     | INFO
 message   | Initializing system_auth.previous_passwords

@ Row 4
-----------+--------------------------------------------
 timestamp | 1664982569825
 level     | INFO
 message   | Opening /home/smiklosovic/dev/cassandra/cassandra-instaclustr/cassandra/data/data/system_auth/previous_passwords-2b9b553e9dd3369d89914288ffe5ef66/nb-2-big (0.110KiB)

@ Row 5
-----------+--------------------------------------------
 timestamp | 1664982569833
 level     | INFO
 message   | Initializing system_auth.resource_role_permissons_index

(5 rows)
{code}

Schema so far is like:

{code}
VIRTUAL TABLE system_views.instance_logs (
    timestamp bigint PRIMARY KEY,
    level text,
    message text
) WITH comment = 'Cassandra logs';
{code}

The questions are:

1) we should think more about the schema of such table so it comfortably to query (e.g. get me all errors last three days)
2) we should limit the size of log entries so this does not grow into infinity
3) more tests
4) some more configurability?

[~MichielSA] feel free to write down your ideas!

[~brandon.williams] what do you think? Good concept?

(1) [https://github.com/apache/cassandra/pull/1900]

> Get warning and errors through virtual tables
> ---------------------------------------------
>
>                 Key: CASSANDRA-17948
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17948
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michiel Saelen
>            Priority: Normal
>
> The warnings and errors are currently only accessible through Cassandra logs. Automating the monitoring of the nodes would be much easier/secure if we can make use of virtual tables to get the logs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org