Skip to main content
A variable puts a value chosen above the grid into the queries, titles, and links of every panel. One dashboard then serves every service, host, or environment, without a copy for each.

Add a variable

Open the editor, select Settings → Variables, and add a variable: Save the dashboard to keep the variable.

Types

Query variables

A query variable reads its values in the current time range. Choose the Query type: The first value becomes the default. A query can use another variable, for example an SQL statement with WHERE environment = '$env', so choosing an environment narrows the services.

Use a variable

Write $name or ${name} in a query, a panel title, a text element, or a link. The braces are needed when letters follow the name, for example ${service}_errors. A variable with several values gives them joined with commas; add a format to change that: For example, a PromQL panel sum(rate(http_requests_total{service=~"${service:regex}"}[5m])) follows the selected services.

Values in the address

The chosen values are kept in the address of the dashboard as var-<name>=<value>, repeated for each value of a multi-value variable. Copy the address, or build a link with these parameters, to open the dashboard with the same choice. A data link can pass the variables on as well.

Repeat panels by a variable

On the Panel tab of a panel, choose a Repeat variable. The dashboard then draws one copy of the panel for each selected value, with the variable set to that value in the copy. Choose the Repeat direction: Horizontal, Vertical, or Grid, and Max per row. Only the original panel is saved; the copies follow the selection.
Last modified on October 26, 2026