My answer tries to elaborate on Carl's answer. I assume that the GUI layout may have changed a little since 2016, so it took me while to find the "name" option.
Assuming you have a metric as follows:
# HELP db2_prometheus_adapter_info Information on the state of the DB2-Prometheus-Adapter
# TYPE db2_prometheus_adapter_info gauge
db2_prometheus_adapter_info{app_state="UP"} 1.0
and you would like to show the value of the label app_state.
Follow these steps:
- Create a "SingleStat" visualization.
- Go to the "Queries" tab:
- Enter the name (here
db2_prometheus_adapter_info) of the metric. - Enter the label name as the legend using the
{{[LABEL]}}notation (here{{app_state}}). - Activate the "instant" option.
- Enter the name (here

- Go to the "Visualization" tab:
- Choose the value "Name" under "Value - Stat".

Note on the "Instant" setting: This setting switches from a range query to a simplified query only returning the most recent value of the metric (also see What does the "instant" checkbox in Grafana graphs based on prometheus do?). If not activated, the panel will show an error as soon as there is more than one distinct value for the label in the history of the metric. For a "normal" metric you would remedy this by choosing "current" in the "Value - Stat" option. But doing so here prevents your label value to be shown.
Answer from Marcus Rickert on Stack OverflowMy answer tries to elaborate on Carl's answer. I assume that the GUI layout may have changed a little since 2016, so it took me while to find the "name" option.
Assuming you have a metric as follows:
# HELP db2_prometheus_adapter_info Information on the state of the DB2-Prometheus-Adapter
# TYPE db2_prometheus_adapter_info gauge
db2_prometheus_adapter_info{app_state="UP"} 1.0
and you would like to show the value of the label app_state.
Follow these steps:
- Create a "SingleStat" visualization.
- Go to the "Queries" tab:
- Enter the name (here
db2_prometheus_adapter_info) of the metric. - Enter the label name as the legend using the
{{[LABEL]}}notation (here{{app_state}}). - Activate the "instant" option.
- Enter the name (here

- Go to the "Visualization" tab:
- Choose the value "Name" under "Value - Stat".

Note on the "Instant" setting: This setting switches from a range query to a simplified query only returning the most recent value of the metric (also see What does the "instant" checkbox in Grafana graphs based on prometheus do?). If not activated, the panel will show an error as soon as there is more than one distinct value for the label in the history of the metric. For a "normal" metric you would remedy this by choosing "current" in the "Value - Stat" option. But doing so here prevents your label value to be shown.
We recently added support for displaying the series name as a value in the single stat panel (https://github.com/grafana/grafana/issues/4740). So you have to run our nightly build until we release version 4.0.
Just make sure the query returns one series and you can use the "name" value in the dropdown under Options -> big value. Then you can format the string using the legend formatter. Ex {{job}} would return "node" as a series name.
I hope this answers your question.