How to use label values in panels on grafana v7.0.0

Hi, I’m trying to create a table which displays the basic info of the mysqld instance, using the metric mysql_version_info from mysqld-exporter,

The metric has following labels:
mysql_version_info{innodb_version="10.3.10",instance="foo",job="bar",version="10.3.10-MariaDB-1:10.3.10+maria~bionic",version_comment=" binary distribution"}

Using the above labels, I want to create a table panel like the following.

key value
innodb_version 10.3.10
instance foo
version_comment binary distribution

My environment:
Grafana: Using docker image v7.0.0

Does anyone have a good idea on how to do this?

I don’t know how you would do that using the exporter as the source.

If you can add a database datasource to your MySQL database then you can achieve this easily with a query something like:
show variables where VARIABLE_NAME in ('innodb_version', 'version', 'version_comment')

Although I don’t know what your job and instance values are or where you would get them from your database but could easily be added to the query with a UNION or something if you can return them from the db.

1 Like

Thanks for the reply.
Following your advice, I was able to create a table pretty much the same with what I’d wanted with mysql datasource.

But still, there are some other occasions where I want to extract label values and display them on a panel…
I’ve found a variable called label_values() in the docs, which looks like what I need.

But just typing this into query field didn’t work. Anyone knows how I use this variable?