What Grafana version and what operating system are you using?
Grafana v7.3.1 (6668161a88) on Linux (official Docker image)
What are you trying to achieve?
I’m using the JMX Exporter to collect metrics from several Tomcat instances. Each instance has a different set of DB pools. I would like to have a single dashboard with all the time series for all DB pools of all instances.
Example:
- instance
foo
, pool nameoracle_1
- instance
foo
, pool nameoracle_2
- instance
bar
, pool namemysql
- instance
baz
, pool nameoracle_1
(note, coincidentally same as above) - instance
baz
, pool namepostgres
How are you trying to achieve it?
At first I tried using two template variables, one for the instances and one for the pool names, using one for the rows and the other for the inner panel, but I found out that it’s not possible.
The two distinct variables are:
- instance:
label_values(up{job='jmx'}, instance)
- pool name:
label_values(tomcat_dbpool_numactive, name)
And the way I can use them in my panel:
tomcat_dbpool_numactive{instance=~"$container", name=~"$name"}
But the result is a table with the outer product of all possible instances × pool names, which in my case is mostly empty (eg. there is no pool oracle_1
on bar
, there is no oracle_2
on bar
nor baz
, etc.)
Therefore I’d like to define a single variable with the actual combinations of values for instance × pool name. For example:
foo:oracle_1
foo:oracle_2
bar:mysql
baz:oracle_1
baz:postgres
But I have no idea how to define such a variable, let alone how to use it in my queries.