Skip to main content

ClickHouse analytics DB

v0.2.8

ClickHouse server + table introspection — metrics, errors, slow & failed queries, parts/partitions, merges, mutations, replication queue, Keeper/ZK health, detached parts, distributed-send backlog, backups — plus narrow mutators (OPTIMIZE, KILL QUERY, SYSTEM RELOAD CONFIG, replica ops). Auth via CH_HOST + CH_USER + CH_PASSWORD env vars on the runner host. Uses clickhouse-client with --query to keep arg surface minimal.

26 allowed by default 4 need approval by default 2 denied by default
Pack ID
clickhouse
Vendor
emisar
OS
linux
Actions
32
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
clickhouse-client

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install clickhouse --hash sha256:102855cbb046d9b72e7297e749c39d0f787dbc6fd237511c71a59a46eef366a9

Actions 32 total

View on GitHub
  • ch.asynchronous_metrics exec low

    SELECT * FROM system.asynchronous_metrics

    Show periodically-computed metrics — replica lag (ReplicasMaxAbsoluteDelay), max parts per partition, filesystem and memory. The async counterpart to system.metrics.

    View source on GitHub
  • ch.backups exec low

    SELECT * FROM system.backups

    List BACKUP/RESTORE operations since the last server start with status and error. Non-persistent across restarts.

    View source on GitHub
  • ch.detached_parts exec low

    SELECT * FROM system.detached_parts

    List parts ClickHouse detached and will not auto-attach (corruption, manual detach, broken), each with a reason. Empty is healthy.

    View source on GitHub
  • ch.dictionaries exec low

    SELECT * FROM system.dictionaries

    List loaded dictionaries with status, element count, source.

    View source on GitHub
  • ch.disks exec low

    SELECT * FROM system.disks

    List configured disks with free/used bytes + paths.

    View source on GitHub
  • ch.distribution_queue exec low

    SELECT * FROM system.distribution_queue

    Show distributed-table async send backlog — pending files, errors, blocked sends. Spot a Distributed table not flushing to shards.

    View source on GitHub
  • ch.errors exec low

    SELECT * FROM system.errors

    List error codes seen since startup with counts and the last message. Spot error storms.

    View source on GitHub
  • ch.keeper_status exec low

    List a Keeper/ZooKeeper path (system.zookeeper)

    List child nodes and metadata under a Keeper/ZooKeeper path. system.zookeeper requires a path filter, so the path arg is mandatory.

    View source on GitHub
  • ch.kill_mutation exec critical

    Cancel a stuck mutation (KILL MUTATION)

    Cancel one ClickHouse mutation by its (database, table, mutation_id) — KILL MUTATION WHERE …. Use to stop a mutation wedged on a failure (see ch.stuck_mutations) so the table's merges and inserts can proceed. Destructive — the mutation is abandoned mid-flight — so risk:critical → default-denied. An operator allows it by explicit policy, and WHICH mutations are permitted is a portal policy decision.

    View source on GitHub
  • ch.kill_query exec high

    KILL QUERY WHERE query_id = '<id>'

    Cancels one running query by ID.

    View source on GitHub
  • ch.merge_queue exec low

    SELECT * FROM system.merges

    List in-progress + queued merges.

    View source on GitHub
  • ch.mutation_queue exec low

    SELECT * FROM system.mutations

    List in-progress + pending mutations (ALTER TABLE).

    View source on GitHub
  • ch.optimize_table exec high

    OPTIMIZE TABLE FINAL

    Forces merge of all parts into one. Heavy disk + CPU.

    View source on GitHub
  • ch.parts_by_partition exec low

    Active part count per partition (system.parts)

    List active parts grouped by partition, top offenders first. Where you actually diagnose too-many-parts / merge backlog (parts_summary is table-level only).

    View source on GitHub
  • ch.parts_summary exec low

    SELECT system.parts (by table)

    List active part counts + sizes per table. Use to spot too-many-parts.

    View source on GitHub
  • ch.processes exec low

    SELECT * FROM system.processes

    List currently-running queries.

    View source on GitHub
  • ch.query_errors exec low

    Failed queries from system.query_log (last hour)

    List queries that failed in the last hour (exception types 3 and 4) with code, message, and query. The error counterpart to slow_queries.

    View source on GitHub
  • ch.reload_config exec high

    SYSTEM RELOAD CONFIG

    Re-reads config.xml + users.xml without restarting.

    View source on GitHub
  • ch.replicas_status exec low

    SELECT * FROM system.replicas

    Show per-replica state — leader, queue size, log delays, errors.

    View source on GitHub
  • ch.replication_queue exec low

    SELECT * FROM system.replication_queue

    Show per-task replication queue — retries, postpones, last exception. Spot stuck fetches/merges (distinct from per-replica state).

    View source on GitHub
  • ch.slow_queries exec low

    system.query_log slowest queries

    List top 50 slowest queries from the last hour.

    View source on GitHub
  • ch.stuck_mutations exec low

    Failing mutations (system.mutations)

    List mutations stuck on a failure (latest_fail_reason set), with the failed part and reason. Narrower than the full mutation queue — surfaces only what is actively failing.

    View source on GitHub
  • ch.system_drop_replica exec critical

    SYSTEM DROP REPLICA <name>

    Remove a replica's metadata from ZooKeeper for one table. Use only for an already-dead replica that is never coming back. The replica cannot rejoin without recreating its tables. Wrong replica name destroys a healthy cluster member's metadata.

    View source on GitHub
  • ch.system_events exec low

    SELECT * FROM system.events

    List process-lifetime event counters.

    View source on GitHub
  • ch.system_flush_logs exec medium

    SYSTEM FLUSH LOGS

    Force write buffered system.*log tables to disk. Use before querying very recent activity from query_log, part_log, etc.

    View source on GitHub
  • ch.system_metrics exec low

    SELECT * FROM system.metrics

    Show per-metric current values (gauges + counters).

    View source on GitHub
  • ch.system_restart_replica exec high

    SYSTEM RESTART REPLICA <table>

    Reinitialize the local replication state for one table. Useful when the replica is stuck or its ZooKeeper state diverged. Heavy — may re-fetch many parts.

    View source on GitHub
  • ch.system_sync_replica exec medium

    SYSTEM SYNC REPLICA <table>

    Wait for the local replica to catch up with all peers. Returns when in sync. Use to confirm replication caught up before doing reads from this replica.

    View source on GitHub
  • ch.table_sizes exec low

    system.tables uncompressed sizes

    List top 50 tables by uncompressed size.

    View source on GitHub
  • ch.tables_overview exec low

    Engine inventory (system.tables)

    List all non-system tables with engine, row/byte totals, and part counts. Engine inventory + fleet shape.

    View source on GitHub
  • ch.uptime exec low

    SELECT version, uptime

    Show server version + uptime.

    View source on GitHub
  • ch.zookeeper_connection exec low

    SELECT * FROM system.zookeeper_connection

    List active Keeper/ZooKeeper connections — host, session age, expiry, API version. Empty on a non-replicated single node.

    View source on GitHub