shatteredsilicon / ssm-submodules

GNU Affero General Public License v3.0
0 stars 2 forks source link

DEBUG=1 option should enable QAN inside SSM to monitor internal QAN database #144

Open gordan-bobic opened 11 months ago

gordan-bobic commented 11 months ago

It should ONLY monitor SELECT and DELETE statements, otherwise it would end up in a runnaway loop where QAN would INSERT a new query from a diffrent host, which would trigger an INSERT of the INSERT of that query, which would then trigger an INSERT of an INSERT of an INSERT of an INSERT .....

Reason why it would be nice to have this is because we may want to: 1) Optimise the SELECTs 2) Optimise the data pruning which currently happens using DELETEs, I'm considering whether it would be better to handle this using partition rotation.

It may also be useful for looking at other optimisations in the future.

This also means that the internal QAN database should be instrumented for monitoring when DEBUG=1 (enable slow log, set long_query_time=0, innodb_monitor_enable=all, etc).

So based on whether DEBUG is enabled, we drop in an additional config file, e.g. /etc/my.cnf.d/zz-debug.cnf, and if DEBUG != 1, rm -f /etc/my.cnf.d/zz-debug.cnf

This would also make it neat as a "demo mode`, to show off all the features in a standalone instance that isn't connected to anything that could be even remotely sensitive.

gordan-bobic commented 4 days ago

DEBUG=1 should also enable mysqld_exporter metrics, in addition to QAN info.