DB
Operations

Metrics and events

Build local dashboards and alerts from gauges, counters, queries, and subscriptions.

system.metrics contains current signed gauges; system.events contains monotonic unsigned counters. Every row includes name, value, and description.

SELECT name, value, description
FROM system.metrics
ORDER BY name;

SELECT name, value, description
FROM system.events
ORDER BY name;

Discover names from the running revision instead of assuming a static list.

Collection rules

  • Poll metrics as current values.
  • Derive counter rates from successive samples; handle process restart by resetting the baseline.
  • Attach build revision, process start time, and collection timestamp.
  • Preserve descriptions with the schema mapping.
  • Use a collection interval no faster than the useful system-table refresh cadence.
  • Keep external history; system tables are local process telemetry.

High-value gauges

AreaRepresentative names
Processmemory_bytes_total, process_virtual_bytes
Query/streamlive_queries, open_subscriptions
Tailcommitted_tail_rows, committed_tail_bytes and their configured maximums
Spill/sealcommitted_tail_spilled_bytes, committed_tail_spilled_chunks, storage_sealed_in_memory_bytes
Parts/storagemanifest part/shard counts, active scan refs, pending retired parts
Compactionconfigured/active jobs, queued shards, completed merges
Cachescurrent bytes/entries/open files and configured maximums
I/O backendrequested/actual backend, queue depth, io_uring availability

Read each row's live description for exact semantics.

High-value counters

AreaRepresentative names
Query volumequery_parse_us_total, query_exec_us_total, process_cpu_us_total, rows_scanned, rows_returned
WALwal_records_appended, wal_bytes_appended, wal_fsyncs
PSIpsi_events_published, psi_events_delivered, enqueue/delivery time, identity violations
Pruningshards, parts, and granules considered/pruned
Storage I/Oread/write operations, bytes, time, sync time, backend fallbacks
Cacheshit/miss counters by metadata, decoded, bitmap, and materialized caches
Memorymemory_governor_ramp_engagements and memory_governor_blocks

Alert design

ConditionSignalFirst response
Process unavailableFailed protocol pingPreserve logs; confirm process/listener/recovery state
Query overloadRising queue_us, server-busy/queue-timeout errorsIdentify long/high-memory queries; reduce intake or fix capacity
Memory pressureRamp/block counter deltas, high RSS/tail/sealed bytesCapture memory profile; inspect tail, queries, streams, flush
Tail not drainingTail rows/bytes rise without part/flush progressInspect disk, flush errors, policy, capacity, compaction
Stream consumer lagPending bytes/events, p95/p99 lag, overflow countFix downstream/backpressure; resubscribe only under app policy
I/O regressionRead/sync time and fallback counters riseCheck backend, kernel, filesystem, device latency
Compaction backlogQueued shards/parts grow and merges stallCheck I/O caps, free space, errors, job sizing
Backup riskScheduled command failure, lag/fence growth, missing drillRepair repository/source health and rerun create + restore drill

Use rate, duration, and multiple corroborating signals. A single counter value after a restart is not an incident.

Query-level evidence

For a latency alert, save the matching rows from system.queries and system.query_log, including:

  • queue, prepare, scan, pipeline, materialize, and serialization time;
  • per-operator time;
  • disk/cache/pruning counters;
  • rows/bytes and peak memory;
  • WAL/commit/PSI time for mutations; and
  • relation UUID/version where present.

This makes the alert actionable before escalating to an external profiler.

On this page