I'm making a Grafana dashboard and want a panel that reports the latest version of our app. The version is reported as a label in the app_version_updated
(say) metric like so:
app_version_updated{instance="eu99",version="1.5.0-abcdefg"}
I've tried a number of Prometheus queries to extract the version label as a string from the latest member of this time series, to no effect.
For example, the query
count(app_version_updated) by (version)
returns a {version="1.5.0-abcdefg"}
element with a value of 1
. When put in a Grafana dashboard in a single value panel, this doesn't display the version string but instead the count value (1
).
How can I construct a Prometheus query that returns the version string?