I have a Grafana dashboard with template variables for services
and instances
. When I select a service how can I make it filter the second template variable list based on the first?
To create a new variable, go to your Grafana dashboard settings, navigate to the 'Variable' option in the side-menu, and then click the 'Add variable' button. In this case, we use the 'Query' type, where your variable is defined as the results of SQL query.
Prometheus is a monitoring solution for storing time series data like metrics. Grafana allows to visualize the data stored in Prometheus (and other sources). This sample demonstrates how to capture NServiceBus metrics, storing these in Prometheus and visualizing these metrics using Grafana.
You can enable this by selecting the built in -- Mixed -- data source. When selected this will allow you to specify data source on a per query basis. This will, for example, allow you to plot metrics from different Graphite servers on the same Graph or plot data from Elasticsearch alongside data from Prometheus.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With