This is a simple server that periodically scrapes ClickHouse stats and exports them via HTTP for Prometheus consumption.
Exporter could used only for old ClickHouse versions, modern versions have embedded prometheus endpoint. Look details https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#server_configuration_parameters-prometheus
To run it:
./clickhouse_exporter [flags]
Help on flags:
./clickhouse_exporter -h
Credentials(if not default):
via environment variables
CLICKHOUSE_USER
CLICKHOUSE_PASSWORD
Collectors are enabled by providing a --collector.<name>
flag.
Collectors that are enabled by default can be disabled by providing a --no-collector.<name>
flag.
docker build -t clickhouse-exporter .
docker run -d -p 9116:9116 clickhouse-exporter --uri=http://127.0.0.1:8123
docker run -d -p 9116:9116 clickhouse-exporter --uri=tcp://127.0.0.1:9000
Grafana dashboard could be a start for inspiration https://grafana.com/grafana/dashboards/882-clickhouse