From the course: Prometheus and Grafana: Visualizing Application Performance
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Grafana variables
From the course: Prometheus and Grafana: Visualizing Application Performance
Grafana variables
- [Instructor] A Grafana variable is a place order for a value. You can use variables in metric queries, panel titles, and various other parts of your dashboard. But how do they work? When you change a variable's value, the dashboard components update automatically to reflective the value. Grafana has several variable types that can cater to your needs. You have a query which generates a list of values like the name of a resource by querying from a data source. Then we have a text box which displays a text input field with an optional default value. Constants allow you to define a hidden constant variable, which can be useful for metric prefixes. And finally, a data source variable allows you to quickly change the default data source for the entire dashboard. More examples of variable types can be found on Grafana's website. To make the very best of your variable usage, there are some things you need to know. The first is to add defaults, which will pre-populate the dashboards with…