Dashboard variables are useful when you would like to modify dashboard cells without editing the original queries based on which the dashboard is built. You can also use Flux to build queries for dashboard cells.
Dashboard variables can be
v.timeRangeStart
, v.timeRangeStop
, v.windowPeriod
Variables are stored in a v
standing for a particular dashboard
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == v._measurement and r.field == v.field)
|> aggregateWindow(every: v.windowPeriod, fn: mean)
After adding the variable, the dashboard's url will have the following structure appended to its end &vars[variable_name]=value
. This allows you to directly share the dashboard with the variable included with a simple url.
You can create variables for your dashboard in the following ways:
Variable names has to
_
'