Search code examples
clickhouse

Does any monitoring metrics/events exist for ClickHouse keeper?


I am considering using ClickHouse keeper to replace zookeeper for data replication. And zookeeper has lots of useful metrics for monitoring/convenient triage. I checked ClickHouse documents and CurrentMetrics/ProfileEvents files but found no similar monitoring data to zk(https://zookeeper.apache.org/doc/r3.7.0/zookeeperMonitor.html). Pls. direct me to the right way, thanks!


Solution

  • ClickHouse-keeper already supports 4-letter commands 'ruok' and 'mntr'

    # echo 'mntr' | nc localhost 9181
    zk_version  v22.2.1.2764-testing-4fab6bec4ec53b66246a055919a4ed4c0610f650
    zk_avg_latency  0
    zk_max_latency  33
    zk_min_latency  0
    zk_packets_received 15430936
    zk_packets_sent 15430936
    zk_num_alive_connections    1
    zk_outstanding_requests 0
    zk_server_state standalone
    zk_znode_count  4272
    zk_watch_count  235
    zk_ephemerals_count 111
    zk_approximate_data_size    781777
    zk_open_file_descriptor_count   203
    zk_max_file_descriptor_count    18446744073709551615
    zk_followers    0
    zk_synced_followers 0
    
    echo 'ruok' | nc localhost 9181
    imok
    

    It is possible to export those in Prometheus format using external tools like https://github.com/dabealu/zookeeper-exporter

    Future versions will have embedded Prometheus exporter.