Operate

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. MemoryResident over the total memory ceiling. The ceiling is picked from system.asynchronous_metrics.OSMemoryTotal on bare-metal or VM nodes, from CGroupMemoryTotal on containerised or cgroup-limited nodes, and finally from system.server_settings.max_server_memory_usage when neither async metric is exposed. The tile reads X / - 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 to CGroupUserTimeNormalized + CGroupSystemTimeNormalized. The tile shows a gap - not a phantom zero - on any node that reports neither family.
  • Active queries. count() on system.processes, minus the poller’s own probes (which are stamped with a marker string so they never rank against themselves).
  • Long-running. count() on system.processes where elapsed > 60. The one number to look at when a user reports the app hanging.
  • Replica lag. The largest absolute_delay across system.replicas. Zero on a single-node cluster.
  • Merges. count() on system.merges where elapsed > 300 - merges that have been running longer than five minutes and are worth a look.
  • Mutations. count() on system.mutations where is_done = 0 - open, in-flight ALTER ... UPDATE / DELETE mutations.
  • Replica errors. count() on system.replicas where is_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 effective parts_to_throw_insert threshold, and an ETA-to-throw column. ETA is the projected minutes to cross the threshold at the current insert-minus-merge rate, and shows -1 when the table is converging.
  • Live queries. A live system.processes pass-through, ordered by elapsed descending. Each row carries query_id, user, query_kind, elapsed_seconds, read_rows, read_bytes, memory_usage, a 500-char query preview, and the replica address. This is where you find a runaway query and hit “kill”.

Last updated