What are dashboard variables and what types exist?
IntermediateConceptGrafana
Answer
Variables make one dashboard reusable across environments, clusters and services. Types: Query (from the datasource), Custom (static list), Constant, Text box, Interval, Datasource (switch between datasources), and Ad hoc filters.
label_values(up{job="api"}, namespace) # query variable
sum by (pod) (rate(http_requests_total{namespace="$namespace"}[$__rate_interval]))
Variables can chain: $pod depends on $namespace.
More on Grafana
What is Grafana and what is it not?BeginnerWhat is a Grafana datasource and how do you provision one?BeginnerHow do multi-value and "All" variables work in PromQL queries?IntermediateWhat are Grafana's built-in time variables?IntermediateWhat does "dashboards as code" mean and what are the options?IntermediateHow do you provision dashboards from files?Beginner