The widget displays a single number based on a read-only SQL query to ClickHouse. You can specify a unit and configure a threshold for the value. The query must return one row; the widget displays the value from the first column.

Example of a valid widget query:

SELECT count() AS value
FROM events
WHERE timestamp >= {{from}} AND timestamp < {{to}}

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
Decimal placesNoPrecision used to display the returned value
UnitNoSuffix displayed with the returned value
Show thresholdNoDisplays <METRIC_VALUE> / <THRESHOLD>, where <METRIC_VALUE> is the current metric value and <THRESHOLD> is the configured thresholdfalse
ThresholdNoThreshold value
Lower value is betterNoConsiders the metric healthy when its value is below the configured thresholdfalse
Warning threshold (%)NoBoundary between red and orange. A metric value above this percentage of the threshold is displayed in orange60
Success threshold (%)NoBoundary between orange and green. A metric value above this percentage of the threshold is displayed in green90

Authorization

Authorization is described in External services.