How can I make a Grafana template with a variable reference another variable using Prometheus as a datasource?
You can reference the first variable in the second variables query. I'm not certain if there is a way using the label_values
helper though.
First variable
query: up
regex: /.*app="([^"]*).*/
Second variable:
query: up{app="$app"}
regex: /.*instance="([^"]*).*/
label_values works just fine using variables. For ex:
label_values(cassandra_keyspace_readlatency_count{product="$product"}, keyspace)