Pro plan from £5 per endpoint per month · see pricing
Secronyx
In the next releaseLinux

ClickHouse

See what is running, merging and stuck inside ClickHouse, which tables have too many parts and how full the disks are, with a login the server keeps read-only. This plugin is in the next Secronyx release; the current download does not include it yet.

What it answers

Questions an on-call engineer asks, which an AI client can answer with this plugin.

  • What is running on ClickHouse right now, and which query has run the longest?
  • Which tables have too many parts, and are merges keeping up?
  • What is stuck in the replication queue, and what reason does the server give?
  • How much space is left on each of the server's disks?
  • Which mutation never finished, and why did its last attempt fail?

What it returns

Each of the plugin's read-only tools, described in words.

  • Queries running on the ClickHouse server right now with their user, client, elapsed time, rows and bytes read, memory and normalised text
  • Merges and part mutations in progress on the ClickHouse server with their table, elapsed time, progress, number of source parts, size and memory
  • Active data parts per ClickHouse table - the part count, partitions, the most parts in one partition, rows and bytes on disk
  • Tasks waiting in the replication queues of this ClickHouse server's replicated tables with their type, age, tries, the part and why they are postponed or failing
  • Disks the ClickHouse server stores data on with their path, type, total, free and unreserved space
  • ALTER UPDATE and DELETE mutations on ClickHouse tables that have not finished, with their age, parts still to do and the last failure

At a glance

Plugin
clickhouse 1.0.0
Publisher
levantar
Platforms
Linux

Tested on

  • ClickHouse 24.3.18 and 24.8.14 on Linux (Ubuntu 24.04, Docker), test lab

How it logs in

Without an explicit choice, install tries the methods that need no secret first, in this order.

  • A user name and password

The least-privilege login

The grant script in the pack. secronyx plugin setup clickhouse --apply runs it with a random password for the new login, or you can run it by hand.

-- Least-privilege login for the clickhouse plugin (ClickHouse 24.3 and -- 24.8). readonly = 1 makes the server refuse every write and every SET -- from this login, whatever it is granted; max_execution_time is the -- server's time limit on its queries, which the plugin cannot set itself. -- It may read the six system tables the tools use and see table names -- (SHOW TABLES: system.parts, merges, mutations and replication_queue hide -- the rows of tables a login cannot see). It grants no access to table -- data. Run with an administrator login (secronyx plugin setup clickhouse -- --apply), or by hand. -- -- The plugin logs in over the MySQL-protocol port (mysql_port), which -- takes sha256_password (the default here) and double_sha1_password -- logins. To keep the login to this host, add HOST LOCAL after the name. CREATE USER `{{user}}` IDENTIFIED BY '{{password}}' SETTINGS readonly = 1, max_execution_time = 15; GRANT SELECT ON system.processes TO `{{user}}`; GRANT SELECT ON system.merges TO `{{user}}`; GRANT SELECT ON system.parts TO `{{user}}`; GRANT SELECT ON system.replication_queue TO `{{user}}`; GRANT SELECT ON system.disks TO `{{user}}`; GRANT SELECT ON system.mutations TO `{{user}}`; GRANT SHOW TABLES ON *.* TO `{{user}}`;

See it run

Terminal recording from the test lab: clickhouse-linux-harness
A real run on the shared test lab.

Read-only, in layers

Every query is fixed text inside the signed pack: one SELECT or WITH statement whose functions are all on the agent's allowlist for that database. It runs in a read-only transaction with server-side statement and lock timeouts, and is always rolled back. Callers can only fill in typed, bounded arguments, which are bound as parameters.

These controls narrow what the plugin can do; none of them is a guarantee on its own. An administrator can still accept a more powerful login on purpose (audited and shown in status), root or Administrator on the host can replace the agent, and the plugin can read whatever its login can see.