Extracting part of a label value in a Stat Panel

Hi. I have a Prometheus info metric and I want to display the value of one of its labels in a Stat Panel. However, the value is pretty long and I want only part of it. Is it possible to extract this part by using a regex and show it in the Stat Panel? I tried to do that by using a dashboard variable but I’m not sure how to display the value in the Stat Panel. Thanks!

1 Like

what grafana version do you use?

I’m using Grafana 7.3.3.

can you show yur info metric?

My metric looks like this:

jvm_info{version=“11.0.8+10-LTS-sapmachine”, runtime=“OpenJDK Runtime Environment”} 1

I want to display in a Stat Panel only 11.0.8. Is this possible to achieve?

you can achieve that using label_replace function