/dashboard page of the HTTP interface, runs every query as the database user whose name and password you type into the page. That user does not have to be default. It needs SELECT on system.dashboards, system.metric_log and system.asynchronous_metric_log.
Create a role for the dashboard
http://localhost:8123/dashboard) and enter dashboard_user and its password. On a self-managed cluster, create the role and the user on every server whose dashboard you open, for example with ON CLUSTER.
What the page reads
The page loads the list of charts fromsystem.dashboards and then runs the query of each chart. In ClickHouse 26.12 every default chart reads from merge('system', '^metric_log') or merge('system', '^asynchronous_metric_log').
The merge table function reads all tables whose names match the pattern and that the user is allowed to see. A matching table that is hidden from the user, because the user has no privilege on it at all, is skipped without an error. A matching table that the user can see but may not read fails the query with ACCESS_DENIED. This is why the role uses wildcard grants: after an upgrade that changes the structure of a system log table, the older data stays in a table with a numeric suffix, such as metric_log_1 (see Querying multiple versions). GRANT SELECT ON system.metric_log* covers those tables too.
With a grant on system.metric_log alone, the result depends on what else the user holds. A user without any other privilege on the system database gets charts that show only the data of the current table. A user who can see the older tables, for example through GRANT SHOW ON *.* or GRANT SHOW TABLES ON system.*, gets an ACCESS_DENIED error for every chart.
Dashboards that query all replicas
system.dashboards contains several dashboards, which you can choose on the page. Some of them collect the metrics of all replicas with the clusterAllReplicas table function. In ClickHouse 26.12:
Overview is the default dashboard of self-managed ClickHouse, and the dashboards whose names start with Cloud are written for ClickHouse Cloud. A dashboard that reads through clusterAllReplicas also needs the REMOTE source privilege:
ClickHouse Cloud
The Advanced dashboard page of the ClickHouse Cloud console is described in Advanced dashboard in ClickHouse Cloud. The native advanced dashboard that this page links to asks you to authenticate. Use a database user with the role above, including theREMOTE grant, because the Cloud dashboards read from all replicas.
Things to know
-
If a chart shows an
ACCESS_DENIEDerror, the message names the missing grant. Add that grant to the role. -
Do not set
readonly = 1for the dashboard user. The page adds theadd_http_cors_headersetting to its requests, and some chart queries have aSETTINGSclause. Withreadonly = 1these are refused with an error such asCannot modify 'add_http_cors_header' setting in readonly mode. If you want the extra restriction, usereadonly = 2, which allows changing settings: -
The page can also render charts from any other table that has the same columns as
system.dashboards. For a custom dashboard, grantSELECTon that table and on the tables its queries read.