How to display prometheus label, as value?

4.5k views Asked by At

I am using the windows node exporter, and it contains a label value of ‘version’ with the windows_os_info query. I am running grafana 7.2.1, and have tried various configurations I cannot get it to just show the ‘version’ . Any ideas?

Current View

enter image description here

2

There are 2 answers

2
sskrlj On

Try sum by (version) (your_original_query_here).

1
Saf On

It sounds like you may be best using a table for this. I have tested this with a similar query of:

sum by (instance,version) (windows_os_info)

Then creating a table with the following options:

Query options

Then under the transform section select "Organize fields" and have it display only the instance and version.

You can of course play around with this so it displays as per your needs.

The end result looks something like:

Table