Can I group by labels and only look at the values in one label (with the highest value)?

Viewed 15

Is it possible to do a query in Prometheus in such a way that I get only the label with the highest value in it, and then I can do min/max/avg on that time series?

Or is there perhaps a better way to let me do what I want? My use-case is a number of labels with timestamps in them, and I'm only interested in the timestamps in the time series with the latest timestamp.

Example (I know those are not timestamps):

my_metric{group="group a"}  90, 100
my_metric{group="group b"}  89, 99, 102
my_metric{group="group c"}  101

Should return me the timeseries of "group b" so I can get min, max, and so on on that time series.

0 Answers
Related