Skip to content
BleemeoBleemeo

ClickHouse

Auto-Detection
Built-in Metrics
Prometheus Metrics

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.

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:

Terminal window
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: 8123
EOF

Glouton automatically detects configuration changes.

MetricDescription
service_statusStatus of ClickHouse
clickhouse_events_queryNumber of queries executed per second
clickhouse_events_select_queryNumber of SELECT queries executed per second
clickhouse_events_failed_queryNumber of failed queries per second
clickhouse_events_query_time_secondsTime spent executing queries per second, in seconds
clickhouse_events_mutation_time_secondsTime spent applying mutations per second, in seconds
clickhouse_events_slow_readNumber of slow reads from the filesystem per second
clickhouse_events_network_receive_bytesBytes received over the network per second
clickhouse_events_network_send_bytesBytes sent over the network per second
clickhouse_metrics_active_queryNumber of queries currently being executed
clickhouse_metrics_memory_trackingAmount of memory currently allocated by the server, in bytes
clickhouse_metrics_delayed_insertsNumber of INSERT queries currently throttled because of too many parts
clickhouse_metrics_broken_disksNumber of disks currently in a broken state
clickhouse_metrics_broken_distributed_bytes_to_insertBytes of broken distributed data pending insertion
clickhouse_metrics_broken_distributed_files_to_insertNumber of broken distributed files pending insertion
clickhouse_mutations_runningNumber of mutations currently running
clickhouse_mutations_failedNumber of failed mutations
clickhouse_processes_longest_runningDuration of the longest currently running query, in seconds
clickhouse_asynchronous_metrics_replicas_max_queue_sizeLargest replication queue size across replicated tables

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.

Terminal window
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"
EOF

Glouton automatically detects configuration changes.

MetricDescription
ClickHouseProfileEvents_QueryTotal number of queries executed by ClickHouse
ClickHouseMetrics_QueryNumber of queries currently being executed
ClickHouseAsyncMetrics_*Asynchronous metrics including system-level resource usage
ClickHouseProfileEvents_InsertedRowsTotal number of rows inserted into tables
ClickHouseMetrics_MemoryTrackingAmount of memory currently allocated by the server in bytes