Monitoring ClickHouse can feel scattered, especially when jumping between system tables and ad hoc queries. In a previous blog post, the ClickHouse Support team provided some “essential monitoring queries” to help users monitor their ClickHouse instance using ClickHouse’s powerful system tables. In this post, we’ll turn those essential queries from our earlier blog into a centralized, reusable dashboard in ClickHouse Cloud, giving you real-time visibility in just a few clicks.
Here’s the end result of what we’ll create:

We’ll start by running a query on system.parts to provide a global overview of my cluster. Specifically, it shows the biggest tables in terms of rows, data and primary key size:
SELECT
table,
sum(rows) AS rows,
max(modification_time) AS latest_modification,
formatReadableSize(sum(bytes)) AS data_size,
formatReadableSize(sum(primary_key_bytes_in_memory)) AS primary_keys_size,
any(engine) AS engine,
sum(bytes) AS bytes_size
FROM clusterAllReplicas(default, system.parts)
WHERE active
GROUP BY
database,
table
ORDER BY bytes_size DESCIn ClickHouse Cloud, we’ll save this query, and add it to a new dashboard - Monitoring SELECT queries:


When I navigate to the Dashboards tab, I’ll now see a brand new dashboard with a table component that I just added:

I’ll keep adding a few more queries from the blog post to this dashboard as tables. I’ll create my first line chart showing average query duration and number of requests, which works great as a time-series line graph in the SQL console:

I’ll add this visualization to our dashboard. I’ll also add a legend and change the formatting of my series so hovering over the series only shows one decimal point:

Finally, I’ll add one more table showing which users have been running the most queries recently. I now have a dashboard which I can keep reference to monitor queries on my cluster. As a final step, I’ll use ClickHouse Query Parameters to add a time-based filter to my line chart so the dashboard is interactive. I’ll modify the underlying query, and save it:

I’ll configure a "Filter" as the value source for this filter, and keep a 3-day default:

Now, viewers of my dashboard can toggle how many days of data they see on the line graph:

Here’s the final result! Each dashboard has a custom URL, so it’s easy to share this dashboard with colleagues in the same Cloud organization via the browser’s URL:

With this dashboard in place, you’ll spend less time hunting down queries you previously wrote, and more time optimizing performance. Try building your own with sample queries, or customize queries to fit your specific workload.
오늘 ClickHouse Cloud로 시작하고 $300의 크레딧을 받으세요. 30일 무료 체험이 끝나면 사용한 만큼 지불하는 요금제로 계속 이용하거나, 볼륨 기반 할인에 대해 자세히 알아보려면 문의하기를 이용하세요. 자세한 내용은 요금 페이지를 참조하세요.



