Dashboard Configure Variables
Dashboard variables act as placeholders in panel queries. They allow dashboards to adapt based on user selections—such as cluster, namespace, environment, or service—without changing the underlying queries.
Variables improve reusability by letting you: * Switch between environments without duplicating dashboards. * Filter data across all panels with a single selection. * Provide drop-downs, text inputs, or pre-defined options to dashboard viewers.
You can configure several types of template variables:
Configure Template Variables
Template variables let you dynamically filter dashboards using runtime values from your telemetry data, such as namespace, cluster, pod, or service.
Create a Template Variable
-
In the dashboard, open the Actions menu.
-
Select Configure variables.
-
Click Add Variable.
General Settings
-
Name — Internal reference used in queries (e.g.,
$namespace) -
Label — Optional UI label (e.g., Namespace)
-
Description — Optional help text visible in the dropdown
-
Variable type — Select from:
-
Query(default): populate values dynamically from the backend
-
Query Options
-
Stream type — Choose
Metrics,Logs, or other supported types -
Query type — Select how to extract values:
-
Label values— populate from label keys -
Series— match full series names
-
-
Label — Choose a label such as
service_namespaceorcluster -
Metric — Optional, limit values to a specific metric
Filter values
Use filters to narrow results:
-
Combine filters using key, operator, and value
-
Click
+to add multiple filter conditions
Use Regex
Use regex to extract or format display values.
Example:
/.+(?<text>.*):(?<value>.*)/
This lets you split a label or metric into display name and internal value.
Use a Textbox Variable
Use a Custom Variable
Set the variable type to Custom to define a static list of values manually.
General Settings
Same as query variables:
* Name — Internal reference (e.g., $threshold)
* Label — Optional display name
* Description — Optional help text
Custom Options
Define custom values in the textbox using comma-separated format.
You can specify:
* Simple values: 20, 30
* Key-value format: key1: value1, key2: value2
* Escaped characters: escaped\\,value
|
Escape commas ( |