Skip to content

QueryVariableBuilder🔗

Constructor🔗

new QueryVariableBuilder(string $name)

Methods🔗

build🔗

Builds the object.

build()

allValue🔗

Custom all value

allValue(string $allValue)

current🔗

Shows current selected variable text/value on the dashboard

current(\Grafana\Foundation\Dashboard\VariableOption $current)

datasource🔗

Data source used to fetch values for a variable. It can be defined but null.

datasource(\Grafana\Foundation\Dashboard\DataSourceRef $datasource)

description🔗

Description of variable. It can be defined but null.

description(string $description)

hide🔗

Visibility configuration for the variable

hide(\Grafana\Foundation\Dashboard\VariableHide $hide)

includeAll🔗

Whether all value option is available or not

includeAll(bool $includeAll)

label🔗

Optional display name

label(string $label)

multi🔗

Whether multiple values can be selected or not from variable value list

multi(bool $multi)

name🔗

Name of variable

name(string $name)

options🔗

Options that can be selected for a variable.

@param array<\Grafana\Foundation\Dashboard\VariableOption> $options

options(array $options)

query🔗

Query used to fetch values for a variable

@param string|array $query

query($query)

refresh🔗

Options to config when to refresh a variable

refresh(\Grafana\Foundation\Dashboard\VariableRefresh $refresh)

regex🔗

Optional field, if you want to extract part of a series name or metric node segment.

Named capture groups can be used to separate the display text and value.

regex(string $regex)

sort🔗

Options sort order

sort(\Grafana\Foundation\Dashboard\VariableSort $sort)

See also🔗