ClickHouse Health Metrics Reference
Exported ClickHouse health metrics, grouped by source, with types, labels, and interpretation.
Use this reference with ClickHouse Database Monitoring for prerequisites, permissions, configuration, and troubleshooting.
Every suffix below is prefixed with groundcover_db_ch_. For example, connections is exported as groundcover_db_ch_connections. Metrics include server_address, server_port, integration labels such as gc_integration_name, and configured extra labels. Group-specific labels are described below; avoid extra labels that overwrite these dimensions.
Counters are raw cumulative database counters: use rate() or increase() to measure activity over time and handle resets. Gauges describe the current observation. A missing series can mean a disabled group, missing capability/permission, filtering, top-N selection, or an empty source. It does not imply zero. See collection diagnostics.
In cluster mode, health queries use cluster() (one replica per shard) and add shard_number, a zero-based shard label. These metrics are not an exhaustive per-replica inventory. Statement measurements have a separate all-replica collection path.
Parts
system.parts; active parts only. Labels: db_namespace and db_collection_name. Top tables are ranked by active part count.
parts_active
Gauge; parts
Active part count.
parts_level0
Gauge; parts
Active parts with merge level zero.
parts_by_type
Gauge; parts
Active Compact or Wide parts. part_type: compact, wide.
parts_bytes
Gauge; bytes
On-disk, compressed, or uncompressed bytes of active parts. kind: on_disk, compressed, uncompressed.
parts_rows
Gauge; rows
Rows in active parts.
parts_merge_level_max
Gauge; merge level
Highest merge level among active parts.
Merges
system.merges; labels: db_namespace and db_collection_name. Empty when no merges run.
merges_running
Gauge; merges
Currently running merges for the table.
merge_longest_elapsed_seconds
Gauge; seconds
Elapsed time of the longest running merge.
merge_min_progress
Gauge; ratio
Lowest progress among running merges, as a fraction.
Mutations
system.mutations; labels: db_namespace and db_collection_name. Completed mutations are excluded.
mutations_pending
Gauge; mutations
Mutations whose is_done value is 0.
mutations_failed
Gauge; mutations
Pending mutations with a nonempty latest_fail_reason; a current count, not a cumulative failure counter.
Replication
system.replicas; table series have db_namespace and db_collection_name. readonly_replicas is server/shard-wide and may be zero even when there are no replicated tables.
replication_queue
Gauge; entries
Replication queue entries.
replication_queue_by_kind
Gauge; entries
Queued inserts or merges. kind: insert, merge.
replica_delay_seconds
Gauge; seconds
Absolute replication delay reported by the replica.
replica_log_delay
Gauge; log positions
Nonnegative difference between log_max_index and log_pointer.
replica_future_parts
Gauge; parts
Parts that will result from in-progress work.
replica_parts_to_check
Gauge; parts
Parts queued for verification.
replicas_active
Gauge; replicas
Active replicas reported for the replicated table.
replicas_total
Gauge; replicas
Total replicas reported for the replicated table.
readonly_replicas
Gauge; table-replica entries
Count of read-only entries in system.replicas, aggregated across tables on the queried server/shard. This is not a count of distinct cluster nodes.
Connections
system.metrics; interface is http, tcp, or interserver. Missing source counters produce no corresponding series.
connections
Gauge; connections
Current connections by interface.
Capacity
system.asynchronous_metrics, system.metrics, and system.disks. Labels: metric for selected values; disk and kind for capacity.
async_metric
Gauge; source-dependent
Value identified by the metric label; units depend on that source metric. MemoryTracking comes from system.metrics.
disk_bytes
Gauge; bytes
Free or total space reported for a disk. kind: free, total.
By default, async_metric has these metric label values:
MemoryTracking
Bytes
Current tracked memory from system.metrics.
MaxPartCountForPartition
Parts
Maximum part count for a partition.
Uptime
Seconds
Server uptime.
NumberOfDatabases
Databases
Database count.
NumberOfTables
Tables
Table count.
MarkCacheBytes
Bytes
Memory occupied by the mark cache.
Other label values depend on the configured include list and source metrics. See Customizing included metrics to discover names and configure selection.
Events
system.events; event identifies the cumulative counter.
events_total
Counter; source-dependent
Cumulative event value identified by the event label. Default events are counts; explicitly included events can have other units defined by ClickHouse.
Default event label values are Query, FailedQuery, FailedSelectQuery, FailedInsertQuery, DelayedInserts, RejectedInserts, ReplicatedPartFailedFetches, and DistributedConnectionFailTry. These represent query activity/failures, insert pressure, failed part fetches, and distributed connection failures. Additional events require an explicit include list or wildcard.
Detached parts
system.detached_parts; labels: db_namespace, db_collection_name, and reason_class. Empty when no detached parts exist.
detached_parts
Gauge; parts
Detached parts by reason class: corrupted, manual, or other.
Table sizes
system.tables; labels: db_namespace and db_collection_name. Separate top-N queries rank by rows and bytes, so the selected tables can differ. NULL totals are omitted.
table_rows
Gauge; rows
total_rows reported by system.tables, when available.
table_bytes
Gauge; bytes
total_bytes reported by system.tables, when available.
View refreshes
system.view_refreshes; requires status, last_success_time, and written_rows columns. Labels include db_namespace, db_collection_name, and status on the status series. Empty when no refreshable views exist.
view_refresh_status
Gauge; constant 1
Constant 1 with the current status in a label; the numeric value is not a success/failure code.
view_refresh_last_success_age_seconds
Gauge; seconds
Seconds since the last successful refresh; omitted if no timestamp is available.
view_refresh_written_rows
Gauge; rows
Written rows reported by system.view_refreshes; a gauge, not a cumulative counter.
Dictionaries
system.dictionaries; labels: db_namespace and dictionary. Empty when no dictionaries exist.
dictionary_memory_bytes
Gauge; bytes
Bytes allocated by a dictionary.
dictionary_items
Gauge; elements
Dictionary element count.
dictionary_load
Gauge; ratio
Dictionary load_factor. This is a load factor, not a load-status code.
Customizing included metrics
Leave include unset for the default Capacity and Events selections above. Customize it only when you need additional metrics or a narrower selection. These are ClickHouse source names, with exact spelling and case, not exported groundcover_db_ch_* metric names.
healthMetrics.groups.capacity.include
Names in system.asynchronous_metrics.metric, plus the special MemoryTracking metric from system.metrics. Other system.metrics names are not selected by this option.
healthMetrics.groups.events.include
Names in system.events.event.
Names depend on the monitored server's capabilities and configuration. Discover the available choices by running these read-only queries as the monitoring user on that server.
Capacity choices and current values:
Event choices, values, and descriptions:
See ClickHouse's asynchronous metric descriptions and event descriptions for interpretation. The values returned by your server determine what can be selected there. In cluster mode, availability can differ between members; repeat the checks on relevant nodes. A name absent from a queried source produces no matching series; a misspelled name does not cause a configuration error.
Omitted
Uses the defaults listed above.
Explicit names
Replaces the defaults. Include default names too if you want to retain them.
[]
Selects no named metrics/events. Capacity still collects disk metrics.
["*"]
Selects all asynchronous metrics plus MemoryTracking for Capacity, or all events for Events, subject to collection result limits. This can substantially increase the number of series.
Explicit lists are bounded to 100 entries and 16 KiB of names. Disk capacity is collected independently of the Capacity include list. Applied bounds and collection errors appear in the collection diagnostics.
For example, merge these group settings into the existing integration config to select only the named Capacity and Events values, while retaining disk collection:
Capacity values appear as groundcover_db_ch_async_metric{metric="<name>"}; events appear as groundcover_db_ch_events_total{event="<name>"}. Use rate() or increase() for cumulative events and check each event's unit before combining values.
Query examples
Replace <integration-name> with the integration name. Choose a rate window spanning several scrapes.
Query event rate:
Free disk space:
Pending mutations with a recorded failure reason:
Last updated
