ClickHouse
ClickHouse is a high-performance, column-oriented SQL database for real-time analytics.
Glouton can monitor ClickHouse in two ways:
- Auto-detection — recommended, minimal configuration. Glouton detects ClickHouse and collects a curated set of built-in metrics.
- Prometheus metrics — scrape ClickHouse’s native Prometheus endpoint for a fully customizable set of metrics.
Auto-Detection
Section titled “Auto-Detection”Glouton detects ClickHouse by its process and listening port (default HTTP interface: 8123).
To gather metrics, Glouton queries ClickHouse’s system tables over the HTTP interface, which requires credentials. The user (default: default) must be allowed to read the system.* tables.
If the auto-detected parameters are incorrect, override them manually:
sudo tee /etc/glouton/conf.d/99-clickhouse.conf > /dev/null << 'EOF'service: - type: "clickhouse" username: "default" password: "PASSWORD" address: "127.0.0.1" port: 8123EOFCreate or edit C:\ProgramData\glouton\conf.d\99-clickhouse.conf:
service: - type: "clickhouse" username: "default" password: "PASSWORD" address: "127.0.0.1" port: 8123Glouton automatically detects configuration changes.
| Metric | Description |
|---|---|
service_status | Status of ClickHouse |
clickhouse_events_query | Number of queries executed per second |
clickhouse_events_select_query | Number of SELECT queries executed per second |
clickhouse_events_failed_query | Number of failed queries per second |
clickhouse_events_query_time_seconds | Time spent executing queries per second, in seconds |
clickhouse_events_mutation_time_seconds | Time spent applying mutations per second, in seconds |
clickhouse_events_slow_read | Number of slow reads from the filesystem per second |
clickhouse_events_network_receive_bytes | Bytes received over the network per second |
clickhouse_events_network_send_bytes | Bytes sent over the network per second |
clickhouse_metrics_active_query | Number of queries currently being executed |
clickhouse_metrics_memory_tracking | Amount of memory currently allocated by the server, in bytes |
clickhouse_metrics_delayed_inserts | Number of INSERT queries currently throttled because of too many parts |
clickhouse_metrics_broken_disks | Number of disks currently in a broken state |
clickhouse_metrics_broken_distributed_bytes_to_insert | Bytes of broken distributed data pending insertion |
clickhouse_metrics_broken_distributed_files_to_insert | Number of broken distributed files pending insertion |
clickhouse_mutations_running | Number of mutations currently running |
clickhouse_mutations_failed | Number of failed mutations |
clickhouse_processes_longest_running | Duration of the longest currently running query, in seconds |
clickhouse_asynchronous_metrics_replicas_max_queue_size | Largest replication queue size across replicated tables |
Prometheus Metrics
Section titled “Prometheus Metrics”Service Configuration
Section titled “Service Configuration”ClickHouse exposes Prometheus metrics since version 20.1.2.4. Add a <prometheus> section to your configuration by editing config.xml or creating a drop-in file at /etc/clickhouse-server/config.d/prometheus.xml:
<clickhouse> <prometheus> <endpoint>/metrics</endpoint> <port>9363</port> <metrics>true</metrics> <events>true</events> <asynchronous_metrics>true</asynchronous_metrics> </prometheus></clickhouse>Restart ClickHouse for the change to take effect. Metrics are then available at http://localhost:9363/metrics.
Glouton Configuration
Section titled “Glouton Configuration”sudo tee /etc/glouton/conf.d/99-clickhouse.conf > /dev/null << 'EOF'metric: prometheus: targets: - url: "http://localhost:9363/metrics" name: "clickhouse" allow_metrics: - "ClickHouseProfileEvents_Query" - "ClickHouseMetrics_Query" - "ClickHouseAsyncMetrics_*" - "ClickHouseProfileEvents_InsertedRows" - "ClickHouseMetrics_MemoryTracking"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-clickhouse.conf:
metric: prometheus: targets: - url: "http://localhost:9363/metrics" name: "clickhouse" allow_metrics: - "ClickHouseProfileEvents_Query" - "ClickHouseMetrics_Query" - "ClickHouseAsyncMetrics_*" - "ClickHouseProfileEvents_InsertedRows" - "ClickHouseMetrics_MemoryTracking"Glouton automatically detects configuration changes.
| Metric | Description |
|---|---|
ClickHouseProfileEvents_Query | Total number of queries executed by ClickHouse |
ClickHouseMetrics_Query | Number of queries currently being executed |
ClickHouseAsyncMetrics_* | Asynchronous metrics including system-level resource usage |
ClickHouseProfileEvents_InsertedRows | Total number of rows inserted into tables |
ClickHouseMetrics_MemoryTracking | Amount of memory currently allocated by the server in bytes |