Pulse: live cluster vitals
Live ClickHouse health board built on system.* reads. Eight vitals, a heaviest-queries panel, a parts-pressure heatmap, and a live-queries feed - no sidecar exporter, no separate metrics DB.
Pulse is Goni’s bedside monitor for the ClickHouse warehouse. It reads the same tables a DBA would open by hand - system.asynchronous_metrics, system.processes, system.query_log, system.parts, system.replicas, system.merges, system.mutations - and stores the answers in Goni’s control-plane database. There is no sidecar exporter and no third-party agent to install.
You’ll learn:
- What Pulse shows, tile by tile, and where each number comes from
- How the poller refreshes the board, and how it behaves under multiple replicas
- Where the URL lives, which role gates the page, and how the tabs are laid out
- How Pulse relates to the query log and to the Doctor RCA agent
What it is
Open /ops/pulse and you get one page of live cluster vitals: an eight-tile status header across the top, a heaviest-queries panel, a parts-pressure heatmap, and a live-queries feed. The layout is deliberately hospital-monitor plain - the point is that a person on-call can glance and know whether the cluster is fine, warming up, or in trouble.
Every number on the page is a read from ClickHouse’s own system.* tables. Nothing is invented, and nothing depends on a sidecar. A background poller inside bi-api runs a fixed set of SELECT probes on a 30-second tick and stores each result as a JSON payload in Goni’s control-plane database. The read handlers behind the page then serve the latest row per metric so the SPA does not dial the cluster on every render.
The eight vitals
The tile row across the top of /ops/pulse is built from a single per-tick probe called summary. Each tile maps directly to one field in the payload:
- Memory.
MemoryResidentover the total memory ceiling. The ceiling is picked fromsystem.asynchronous_metrics.OSMemoryTotalon bare-metal or VM nodes, fromCGroupMemoryTotalon containerised or cgroup-limited nodes, and finally fromsystem.server_settings.max_server_memory_usagewhen neither async metric is exposed. The tile readsX / -when none is available rather than dividing by a guessed denominator. - CPU. Normalised host CPU busy, computed from
OSUserTimeNormalized + OSSystemTimeNormalized + OSNiceTimeNormalized. On containerised nodes it falls back toCGroupUserTimeNormalized + CGroupSystemTimeNormalized. The tile shows a gap - not a phantom zero - on any node that reports neither family. - Active queries.
count()onsystem.processes, minus the poller’s own probes (which are stamped with a marker string so they never rank against themselves). - Long-running.
count()onsystem.processeswhereelapsed > 60. The one number to look at when a user reports the app hanging. - Replica lag. The largest
absolute_delayacrosssystem.replicas. Zero on a single-node cluster. - Merges.
count()onsystem.mergeswhereelapsed > 300- merges that have been running longer than five minutes and are worth a look. - Mutations.
count()onsystem.mutationswhereis_done = 0- open, in-flightALTER ... UPDATE / DELETEmutations. - Replica errors.
count()onsystem.replicaswhereis_readonly = 1 OR absolute_delay > 60. The count of “something is wrong with a replica right now.”
The tile row also carries a rows-scanned-per-second reading (a rolling minute average from system.query_log) and the server’s uptime, version, and hostname. All from the same one-shot probe, all from system.*.
How refresh works
Pulse is polled, not pushed. Inside bi-api a single goroutine ticks every 30 seconds, walks the fixed metric catalogue, and writes one row per metric into Goni’s control-plane database. Each probe has a 15-second per-metric budget so a stuck parts_pressure on a busy cluster does not stall the tick.
Under multiple bi-api replicas, only one pod polls at a time. The poller holds a Redis lease at goni:ops:pulse_poller:leader on a short TTL; the other pods still tick, notice they do not hold the lease, and skip. When Redis is not wired (single-process dev), the poller behaves as if it always holds the lease. Without this, N replicas would each write N rows per tick and duplicate every pulse-threshold alert dispatch downstream.
Pulse and the storage-parts page currently show no data to customer workspaces, whether on Goni Cloud or with their own ClickHouse attached: the poller reads only Goni’s own server. Stored readings are kept for about 24 hours.
URL and access
Pulse lives at /ops/pulse inside the workspace. It is a workspace-admin surface: the page and every backing endpoint check the caller’s AllowAdminPolicies permission and return 403 when it is not set. Non-admins get a plain “operational tier requires allow_admin_policies” response instead of a silent redirect, so the gate is diagnosable from the network tab. See Access control for how the permission is granted and to whom.
The five endpoints behind the page are all GET, all tenant-scoped from the caller’s JWT, and all read from either the stored snapshots (latest per metric) or a live system.* pass-through:
GET /api/ops/pulse # latest snapshot per metric
GET /api/ops/queries/live # live system.processes, ordered by elapsed
GET /api/ops/queries/log # system.query_log page over a chosen window
GET /api/ops/errors # last-hour exceptions + system.errors counters
GET /api/ops/parts # latest parts-pressure snapshot per table
Kill authority is a separate endpoint - POST /api/ops/kill/{query_id} - gated the same way.
Tabs
/ops/pulse collapses what used to be three sibling pages (Overview, Live queries, Parts) into two tabs on a single page:
- Overview. The eight-vitals tile row across the top, a heaviest-queries panel underneath (top 20 currently-executing queries by memory, from
system.processes), and a parts-pressure heatmap keyed on(database, table)with per-table part count, worst-partition count, the effectiveparts_to_throw_insertthreshold, and an ETA-to-throw column. ETA is the projected minutes to cross the threshold at the current insert-minus-merge rate, and shows-1when the table is converging. - Live queries. A live
system.processespass-through, ordered byelapseddescending. Each row carriesquery_id,user,query_kind,elapsed_seconds,read_rows,read_bytes,memory_usage, a 500-char query preview, and the replicaaddress. This is where you find a runaway query and hit “kill”.
Related
- Query log and Errors drill-down - historical
system.query_logbrowsing, per-error drill-downs, and the row-detail drawer - Doctor RCA agent - the LLM-powered explainer you launch from a runaway or an exception
- Alerts and scheduled reports - includes the
pulse_thresholdalert rule kind that fires off pulse readings - Access control - the admin permission that gates every
/api/ops/*endpoint
Last updated