The widget displays a single number from a PromQL query to Prometheus. The query must return a Scalar or a Vector containing one value.

Example query without placeholders:

sum(machine_cpu_cores)

Example with a placeholder for the time range duration selected in the widget panel:

sum(increase(http_requests_total[{{range}}]))

Query placeholders

Use placeholders when the expression requires the duration of the time range selected in the widget panel. The query runs at the end of this time range.

PlaceholderDescription
{{range}}Duration of the selected time range
{{rateInterval}}Range window for the rate() and increase() functions
{{interval}}Query step calculated from the time range

Configuration

NameRequiredDescriptionDefault value
URLYesPrometheus URL
QueryYesPromQL query that returns one value
Default rangeNoRange used when loading or refreshing the widget unless the user selects another range in the widget panelLast 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
InsecureSkipVerifyNoDisables verification of the Prometheus TLS/SSL certificatefalse

Authorization

Authorization is described in External services.