ClickHouse is the high-performance columnar database powering analytics at companies like Cloudflare, Uber, and Bloomberg. Its speed is legendary—but downtime is catastrophic. Here's how to monitor ClickHouse availability with Vigilmon.
Why ClickHouse Monitoring Matters
ClickHouse is typically used for real-time analytics dashboards and event pipelines. When it goes down:
- Dashboards go blank
- Analytics queries fail
- Data pipelines back up
- Revenue metrics become unavailable
ClickHouse's Built-In Health Endpoint
ClickHouse exposes a built-in HTTP interface on port 8123 with a health endpoint:
# Check ClickHouse health
curl http://your-clickhouse-host:8123/ping
# Returns "Ok." when healthy
This makes HTTP monitoring straightforward.
Setting Up Vigilmon for ClickHouse
Method 1: HTTP Health Monitor (Recommended)
- Log into Vigilmon
- Click Add Monitor → HTTP(S)
- URL:
http://your-clickhouse-host:8123/ping - Expected response:
Ok. - Check interval: 60 seconds
- Enable multi-region probes
Method 2: TCP Port Monitor
Monitor the ClickHouse HTTP port (8123) or native TCP port (9000):
HTTP Interface: Port 8123 (preferred for health checks)
Native TCP: Port 9000 (binary protocol)
HTTPS: Port 8443 (if TLS enabled)
Method 3: Custom Health Query Endpoint
For deeper checks, expose an endpoint that runs a test query:
@app.route('/health/clickhouse')
def ch_health():
try:
result = client.execute('SELECT 1')
return jsonify({"status": "ok", "result": result[0][0]}), 200
except Exception as e:
return jsonify({"status": "error", "message": str(e)}), 503
Monitoring ClickHouse Clusters
For distributed ClickHouse clusters, create separate monitors for:
- Each shard's HTTP endpoint
- The load balancer/proxy endpoint
- The ZooKeeper ensemble (if using ReplicatedMergeTree)
# ZooKeeper health check
echo ruok | nc your-zookeeper-host 2181
# Returns "imok" when healthy
ClickHouse-Specific Metrics to Track
While Vigilmon handles availability, also monitor these internally:
| Metric | Significance |
|---|---|
clickhouse_queries |
Query rate (drop = potential issue) |
clickhouse_merge_queue_size |
Background merge backlog |
clickhouse_replication_delay |
Replica lag in seconds |
clickhouse_memory_usage |
Memory pressure |
Conclusion
ClickHouse's built-in /ping endpoint makes it one of the easiest databases to monitor with Vigilmon. Set up HTTP monitoring in 2 minutes and never be caught off-guard by a ClickHouse outage again.
Top comments (0)