Something like outlined in the article should be doable without too much complexity. However, I also need to be able to use the result for AS12322 and I didn't disclose everything in the article. I need to tinker a bit more.
a) add these 'metric counters' in a little more friendly way than mess with ClickHouse itself (maybe a directory with *.sql to be loaded on the start/file change?)
b) a way to publish them in JSON through the webserver
After that I can just poll the endpoint with a script and do whatever I need with that info.
AFAIR ClickHouse has a built-in REST-like interface, which can be used for that but that means the need to expose ClickHouse itself.