The widget plots a line chart based on a read-only SQL query to ClickHouse. Use the {{from}} and {{to}} placeholders in the query to specify the time range boundaries.

Example of a valid widget query:

SELECT
  toStartOfMinute(timestamp) AS time,
  avg(value) AS value,
  service AS series
FROM metrics
WHERE timestamp >= {{from}} AND timestamp < {{to}}
GROUP BY time, series
ORDER BY time

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
Time columnYesColumn containing timestamps for the chart’s X-axis
Value columnYesColumn containing numeric values for the chart’s Y-axis
Series columnNoColumn used as the series name in the chart legend
ThresholdNoThreshold displayed as a horizontal line on the chart
Minimum valueNoStarting point for the chart’s vertical axis
Maximum valueNoEnd point for the chart’s vertical axis

Authorization

Authorization is described in External services.