Variables
The topic of variables in Grafana has generated a myriad of questions lately. In short, there are three types of variables.
- Dashboard
- Global
- Environment
Dashboard, Global and Environment variables
We created this video to structure the subject and speed up the learning curve for Grafana enthusiasts.
Dashboard variables
Dashboard variables capture the values within one dashboard. They are usually used for filter functionality.
Global variables
Global variables are Grafana settings you can retrieve and use on your dashboards.
Variable | Description |
---|---|
${__dashboard} | Name of the current dashboard. |
${__from} | From of Time Range in epoch milliseconds. |
${__interval} | Parameter to group by time. |
${__org.name} | Name of the current organization. |
${__org} | Id of the current organization. |
${__to} | To of Time Range in epoch milliseconds. |
${__user.email} | Email for the current user. |
${__user.id} | Id of the current user. |
${__user.login} | Login handle of the current user. |
You can find all the global built-in variables in the Grafana documentation.
Environment variables
Environment variables are the variables from the Grafana environment (operating system and/or device) where Grafana is installed.
Conventionally those variables are off-limits, but with the Environment data source, access to the environment variables is possible!
Grafana variables at a glance, Environment data source explained
The following blog post provides more information about variable types with examples.