Dashboard Variables
Dashboard variables allow you to create interactive, dynamic dashboards. They can be used in queries and panel titles to create dashboards that can be easily modified to show different data.
Create a Variable
To add a variable to your dashboard:
- Click the Edit button in the top-right corner of the dashboard.
- Click the Settings button that just appeared.
- The Settings page shows up.
- Choose the Variables tab.
- This page has link to the detailed documentation for variables if needed.
- Click Add variable button.
In the next section we'll take a deeper look at some of the most useful and commonly used variable types.
Types of Variables
Oodle supports all the variable types supported by Grafana. Among those, two most useful and commonly used are Query, and Ad hoc filters.
While the Grafana docs cover the technical details, here we'll focus on how to configure them, and how to use them in dashboards.
Query Variable
Query variables are variables that show up as a dropdown in the dashboard, where the values shown in the dropdown are determined by running a PromQL query.
Let's look at the namespace
variable in the Kubernetes / Views / Namespaces dashboard on Oodle Playground.
Appearance
This variable appears as a dropdown in the dashboard, where you can select the kubernetes namespace.

Configuration
Here's how the configuration page for namespace
looks like:

- Name specifies the name that will be used in the dashboard to reference the variable.
- Query is used to fetch the variable values, which will be displayed in the dropdown.
In this example, it means:
- Query the metric
kube_pod_info
- Only consider the timeseries where
cluster
label equals the value ofcluster
variable. Note how configuration ofnamespace
variable makes use of another variable,cluster
. Also note how$cluster
is used to reference thecluster
variable. - From the resulting timeseries, take the value of
namespace
label. - Take the distinct set of values from the
namespace
label, and populate the dropdown.
- Query the metric
- Multi-value allows to select multiple values from the dropdown.
- Include All option allows to include the special "All" value in the dropdown.
- Preview of values shows all the values that will be present in the dropdown.
Usage
The Kubernetes Resource Count panel uses the namespace
variable by adding $namespace
appropriately in all the queries
of the panel that need to filter by namespace:

Ad-hoc Filters
Appearance
Ad-hoc filters show up as double-dropdowns in the dashboard, where you can select:
- The PromQL label to filter by
- The value of the label to filter by

Configuration
Ad-hoc filters are configured by choosing Ad-hoc filters in "Select variable type" dropdown.

Usage
Unlike query variables, which need to be referenced in the query using $variable_name
,
ad-hoc filters don't need to be referenced in the query at all. Instead, they are
automatically applied to all the queries in the dashboard.
Support
If you have any questions or need any assistance, please contact us via our help chat app located at the bottom-right of the page or by reaching out to support@oodle.ai.