Skip to content

Choose request metrics for external monitoring ​

Choose a measurement by the question it answers. system.processes describes requests active now; system.query_log describes recorded request events. Coordinator DB does not document a Prometheus metrics endpoint or a built-in mapping from every query counter to a metric name.

sql
SELECT count(*) AS active_requests,
       max(elapsed) AS oldest_elapsed_seconds
FROM system.processes;

The observing request may appear in this snapshot. Do not interpret that count as a perfectly independent external connection count.

For completed work, aggregate terminal history within the observation period your collector manages. Avoid counting both start and finish events as separate executed queries. Distinguish QueryFinish from the two exception event types, and account for any configured minimum logging duration.

Use units in any externally chosen metric names. Durations in query history are milliseconds, elapsed in active requests is seconds, and memory counters are bytes. Terminal peak memory is a per-request peak, so summing it does not report current server memory. A monitoring collector must also handle repeated observations without double counting events.

See process counters, query history and logging settings.