The widget plots a horizontal bar chart based on a read-only SQL query to ClickHouse. The query must return columns containing labels and numeric values. The Limit parameter restricts the number of displayed rows.

Example of a valid widget query:

SELECT service AS label, count() AS value
FROM events
WHERE timestamp >= {{from}} AND timestamp < {{to}}
GROUP BY label
ORDER BY value DESC

Configuration

NameRequiredDescriptionDefault value
QueryYesRead-only SQL query. Use {{from}} and {{to}} to specify the time range
DatabaseNoClickHouse database name passed in the X-ClickHouse-Database header
Default rangeNoRange used when opening or refreshing the widget if no range is specified in the query parametersLast hour
Label columnYesColumn containing the bar labels
Value columnYesColumn containing numeric values that determine bar length
LimitYesMaximum number of rows in the chart10

Authorization

Authorization is described in External services.