Atatus Database Monitoring provides deep visibility into your ClickHouse databases by collecting key system metrics, query summary statistics, active query samples, completed query events, query errors, EXPLAIN plans, and MergeTree parts/merges health. To enable Database Monitoring, the Atatus Infra Agent connects to ClickHouse as a dedicated user with read access to the relevant system.* tables. This guide walks you through the required prerequisites and setup process for self-hosted ClickHouse instances.

Before You Begin

Setup Database Access for the Agent

Connect to your ClickHouse instance using clickhouse-client as a user with privileges to create users and grant access:
  1. Create the atatus user:
  2. Grant SELECT access on the system.* tables the Agent reads:
    The system.processes and system.query_log grants power query activity, query summary, query completions, query errors, and EXPLAIN collection. The system.parts*, system.mutations, system.replicas, and system.replication_queue grants power MergeTree storage health.

Configure Atatus Infrastructure Agent

  1. Install the Atatus Infrastructure agent on a host that can connect to your ClickHouse server.
  2. Copy the ClickHouse example configuration file:
  3. Update the ClickHouse configuration file: Add the following configuration to /etc/atatus-infra-agent/conf.d/clickhouse.d/clickhouse.yml:
    Use clickhouse://host:port for the native protocol (default port 9000) or http://host:8123 for the HTTP protocol.
  4. Restart the Atatus Infra Agent:

Verify

Confirm the atatus user can connect and read the core system.* tables:

Enabling TLS (Optional)

If your ClickHouse server requires TLS (for example, when exposing the native protocol on port 9440), enable the tls block:
Use verification_mode: "none" only for self-signed certificates in test environments.

Tuning DBM Feature Toggles (Optional)

Each Database Monitoring feature can be turned on or off individually under dbm_clickhouse_options. By default, every feature is enabled once dbm: true (except query_explain, which can be opted out via enabled: false).

Query Log Tunables

The following options apply to query_summary, query_completions, query_errors, and query_explain:

EXPLAIN Tunables

Parts and Merges Tunables

Collecting Logs (Optional)

To collect ClickHouse server logs alongside metrics, enable the default log paths or provide custom paths:
If you have custom log paths, define them explicitly:

Overriding the Reported Hostname (Optional)

To report a custom hostname instead of the resolved host:port: