metrics
The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas
function. See here for further details.
Contains metrics which can be calculated instantly, or have a current value. For example, the number of simultaneously processed queries or the current replica delay. This table is always up to date.
Columns:
metric
(String) — Metric name.value
(Int64) — Metric value.description
(String) — Metric description.name
(String) — Alias formetric
.
You can find all supported metrics in source file src/Common/CurrentMetrics.cpp.
Example
SELECT * FROM system.metrics LIMIT 10
┌─metric───────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────┐
│ Query │ 1 │ Number of executing queries │
│ Merge │ 0 │ Number of executing background merges │
│ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │
│ ReplicatedFetch │ 0 │ Number of data parts being fetched from replicas │
│ ReplicatedSend │ 0 │ Number of data parts being sent to replicas │
│ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │
│ BackgroundMergesAndMutationsPoolTask │ 0 │ Number of active merges and mutations in an associated background pool │
│ BackgroundFetchesPoolTask │ 0 │ Number of active fetches in an associated background pool │
│ BackgroundCommonPoolTask │ 0 │ Number of active tasks in an associated background pool │
│ BackgroundMovePoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool for moves │
└──────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────┘
Metric descriptions
AggregatorThreads
Number of threads in the Aggregator thread pool.
AggregatorThreadsActive
Number of threads in the Aggregator thread pool running a task.
TablesLoaderForegroundThreads
Number of threads in the async loader foreground thread pool.
TablesLoaderForegroundThreadsActive
Number of threads in the async loader foreground thread pool running a task.
TablesLoaderBackgroundThreads
Number of threads in the async loader background thread pool.
TablesLoaderBackgroundThreadsActive
Number of threads in the async loader background thread pool running a task.
AsyncInsertCacheSize
Number of async insert hash id in cache
AsynchronousInsertThreads
Number of threads in the AsynchronousInsert thread pool.
AsynchronousInsertThreadsActive
Number of threads in the AsynchronousInsert thread pool running a task.
AsynchronousReadWait
Number of threads waiting for asynchronous read.
BackgroundBufferFlushSchedulePoolSize
Limit on number of tasks in BackgroundBufferFlushSchedulePool
BackgroundBufferFlushSchedulePoolTask
Number of active tasks in BackgroundBufferFlushSchedulePool. This pool is used for periodic Buffer flushes
BackgroundCommonPoolSize
Limit on number of tasks in an associated background pool
BackgroundCommonPoolTask
Number of active tasks in an associated background pool
BackgroundDistributedSchedulePoolSize
Limit on number of tasks in BackgroundDistributedSchedulePool
BackgroundDistributedSchedulePoolTask
Number of active tasks in BackgroundDistributedSchedulePool. This pool is used for distributed sends that is done in background.
BackgroundFetchesPoolSize
Limit on number of simultaneous fetches in an associated background pool
BackgroundFetchesPoolTask
Number of active fetches in an associated background pool
BackgroundMergesAndMutationsPoolSize
Limit on number of active merges and mutations in an associated background pool
BackgroundMergesAndMutationsPoolTask
Number of active merges and mutations in an associated background pool
BackgroundMessageBrokerSchedulePoolSize
Limit on number of tasks in BackgroundProcessingPool for message streaming
BackgroundMessageBrokerSchedulePoolTask
Number of active tasks in BackgroundProcessingPool for message streaming
BackgroundMovePoolSize
Limit on number of tasks in BackgroundProcessingPool for moves
BackgroundMovePoolTask
Number of active tasks in BackgroundProcessingPool for moves
BackgroundSchedulePoolSize
Limit on number of tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc.
BackgroundSchedulePoolTask
Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc.
BackupsIOThreads
Number of threads in the BackupsIO thread pool.
BackupsIOThreadsActive
Number of threads in the BackupsIO thread pool running a task.
BackupsThreads
Number of threads in the thread pool for BACKUP.
BackupsThreadsActive
Number of threads in thread pool for BACKUP running a task.
BrokenDistributedFilesToInsert
Number of files for asynchronous insertion into Distributed tables that has been marked as broken. This metric will starts from 0 on start. Number of files for every shard is summed.
CacheDetachedFileSegments
Number of existing detached cache file segments
CacheDictionaryThreads
Number of threads in the CacheDictionary thread pool.
CacheDictionaryThreadsActive
Number of threads in the CacheDictionary thread pool running a task.
CacheDictionaryUpdateQueueBatches
Number of 'batches' (a set of keys) in update queue in CacheDictionaries.
CacheDictionaryUpdateQueueKeys
Exact number of keys in update queue in CacheDictionaries.
CacheFileSegments
Number of existing cache file segments
ContextLockWait
Number of threads waiting for lock in Context. This is global lock.
DDLWorkerThreads
Number of threads in the DDLWorker thread pool for ON CLUSTER queries.
DDLWorkerThreadsActive
Number of threads in the DDLWORKER thread pool for ON CLUSTER queries running a task.
DatabaseCatalogThreads
Number of threads in the DatabaseCatalog thread pool.
DatabaseCatalogThreadsActive
Number of threads in the DatabaseCatalog thread pool running a task.
DatabaseOnDiskThreads
Number of threads in the DatabaseOnDisk thread pool.
DatabaseOnDiskThreadsActive
Number of threads in the DatabaseOnDisk thread pool running a task.
DelayedInserts
Number of INSERT queries that are throttled due to high number of active data parts for partition in a MergeTree table.
DestroyAggregatesThreads
Number of threads in the thread pool for destroy aggregate states.
DestroyAggregatesThreadsActive
Number of threads in the thread pool for destroy aggregate states running a task.
DictCacheRequests
Number of requests in fly to data sources of dictionaries of cache type.
DiskObjectStorageAsyncThreads
Number of threads in the async thread pool for DiskObjectStorage.
DiskObjectStorageAsyncThreadsActive
Number of threads in the async thread pool for DiskObjectStorage running a task.
DiskSpaceReservedForMerge
Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts.
DistributedFilesToInsert
Number of pending files to process for asynchronous insertion into Distributed tables. Number of files for every shard is summed.
DistributedSend
Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode.
EphemeralNode
Number of ephemeral nodes hold in ZooKeeper.
FilesystemCacheElements
Filesystem cache elements (file segments)
FilesystemCacheReadBuffers
Number of active cache buffers
FilesystemCacheSize
Filesystem cache size in bytes
GlobalThread
Number of threads in global thread pool.
GlobalThreadActive
Number of threads in global thread pool running a task.
HTTPConnection
Number of connections to HTTP server
HashedDictionaryThreads
Number of threads in the HashedDictionary thread pool.
HashedDictionaryThreadsActive
Number of threads in the HashedDictionary thread pool running a task.
IOPrefetchThreads
Number of threads in the IO prefetch thread pool.
IOPrefetchThreadsActive
Number of threads in the IO prefetch thread pool running a task.
IOThreads
Number of threads in the IO thread pool.
IOThreadsActive
Number of threads in the IO thread pool running a task.
IOUringInFlightEvents
Number of io_uring SQEs in flight
IOUringPendingEvents
Number of io_uring SQEs waiting to be submitted