Monitor ClickHouse with Prometheus metrics, Grafana dashboards, system table queries,
and alerting for query performance, merge health, and resource usage.
Use when setting up ClickHouse monitoring, building Grafana dashboards,
or configuring alerts for production ClickHouse deployments.
Trigger: "clickhouse monitoring", "clickhouse metrics", "clickhouse Grafana",
"clickhouse observability", "monitor clickhouse", "clickhouse Prometheus".
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Monitor ClickHouse with Prometheus metrics, Grafana dashboards, system table queries,
and alerting for query performance, merge health, and resource usage.
Use when setting up ClickHouse monitoring, building Grafana dashboards,
or configuring alerts for production ClickHouse deployments.
Trigger: "clickhouse monitoring", "clickhouse metrics", "clickhouse Grafana",
"clickhouse observability", "monitor clickhouse", "clickhouse Prometheus".
Set up comprehensive monitoring for ClickHouse using built-in system tables,
Prometheus integration, Grafana dashboards, and alerting rules.
Prerequisites
ClickHouse instance with system.* table access
Prometheus (or compatible: Grafana Alloy, Victoria Metrics)
Grafana for dashboards
AlertManager or PagerDuty for alerts
Instructions
Step 1: Key Metrics from System Tables
-- Real-time server health snapshotSELECT
(SELECTcount() FROM system.processes) AS running_queries,
(SELECTvalueFROM system.metrics WHERE metric ='MemoryTracking') AS memory_bytes,
(SELECTvalueFROM system.metrics WHERE metric ='Query') AS concurrent_queries,
(SELECTcount() FROM system.merges) AS active_merges,
(SELECTvalueFROM system.asynchronous_metrics WHERE metric ='Uptime') AS uptime_sec;
-- Query throughput (last hour, per minute)SELECT
toStartOfMinute(event_time) ASminute,
count() AS queries,
countIf(exception_code !=0) AS errors,
round((query_duration_ms)) avg_ms,
round(quantile()(query_duration_ms)) p95_ms,
formatReadableSize((read_bytes)) total_read
system.query_log
type (, )
event_time now()
;
toStartOfMinute(event_time) ,
() inserts,
(written_rows) rows_written,
formatReadableSize((written_bytes)) bytes_written
system.query_log
type query_kind
event_time now()
;
database, , () parts, () ,
formatReadableSize((bytes_on_disk)) size
system.parts active
database,
parts
parts ;