Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56771 from ClickHouse/dashboards-table
Load queries for dashboard page from new `system.dashboards` table
- Loading branch information
Showing
5 changed files
with
493 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
slug: /en/operations/system-tables/dashboards | ||
--- | ||
# dashboards | ||
|
||
Contains queries used by `/dashboard` page accessible though [HTTP interface](/docs/en/interfaces/http.md). | ||
This table can be useful for monitoring and troubleshooting. The table contains a row for every chart in a dashboard. | ||
|
||
:::note | ||
`/dashboard` page can render queries not only from `system.dashboards`, but from any table with the same schema. | ||
This can be useful to create custom dashboards. | ||
::: | ||
|
||
Example: | ||
|
||
``` sql | ||
SELECT * | ||
FROM system.dashboards | ||
WHERE title ILIKE '%CPU%' | ||
``` | ||
|
||
``` text | ||
Row 1: | ||
────── | ||
dashboard: overview | ||
title: CPU Usage (cores) | ||
query: SELECT toStartOfInterval(event_time, INTERVAL {rounding:UInt32} SECOND)::INT AS t, avg(ProfileEvent_OSCPUVirtualTimeMicroseconds) / 1000000 | ||
FROM system.metric_log | ||
WHERE event_date >= toDate(now() - {seconds:UInt32}) AND event_time >= now() - {seconds:UInt32} | ||
GROUP BY t | ||
ORDER BY t WITH FILL STEP {rounding:UInt32} | ||
Row 2: | ||
────── | ||
dashboard: overview | ||
title: CPU Wait | ||
query: SELECT toStartOfInterval(event_time, INTERVAL {rounding:UInt32} SECOND)::INT AS t, avg(ProfileEvent_OSCPUWaitMicroseconds) / 1000000 | ||
FROM system.metric_log | ||
WHERE event_date >= toDate(now() - {seconds:UInt32}) AND event_time >= now() - {seconds:UInt32} | ||
GROUP BY t | ||
ORDER BY t WITH FILL STEP {rounding:UInt32} | ||
Row 3: | ||
────── | ||
dashboard: overview | ||
title: OS CPU Usage (Userspace) | ||
query: SELECT toStartOfInterval(event_time, INTERVAL {rounding:UInt32} SECOND)::INT AS t, avg(value) | ||
FROM system.asynchronous_metric_log | ||
WHERE event_date >= toDate(now() - {seconds:UInt32}) AND event_time >= now() - {seconds:UInt32} AND metric = 'OSUserTimeNormalized' | ||
GROUP BY t | ||
ORDER BY t WITH FILL STEP {rounding:UInt32} | ||
Row 4: | ||
────── | ||
dashboard: overview | ||
title: OS CPU Usage (Kernel) | ||
query: SELECT toStartOfInterval(event_time, INTERVAL {rounding:UInt32} SECOND)::INT AS t, avg(value) | ||
FROM system.asynchronous_metric_log | ||
WHERE event_date >= toDate(now() - {seconds:UInt32}) AND event_time >= now() - {seconds:UInt32} AND metric = 'OSSystemTimeNormalized' | ||
GROUP BY t | ||
ORDER BY t WITH FILL STEP {rounding:UInt32} | ||
``` | ||
|
||
Columns: | ||
|
||
- `dashboard` (`String`) - The dashboard name. | ||
- `title` (`String`) - The title of a chart. | ||
- `query` (`String`) - The query to obtain data to be displayed. |
Oops, something went wrong.