Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prometheus / Grafana highest value and time

Is it possible in grafana with a prometheus backend to determine the highest value recorded for the lifetime of a data set, and if so, determine the time that the value occurred?

For example, I'm using site_logged_in as the query in a Singlestat panel to get the current number of logged in users, along with a nice graph of recent activity over the past hour. Wrapping that in a max() seems to do nothing, and a max_over_time(site_logged_in[1y]) gives me a far too low number.

The value is a single gauge value coming from the endpoint like so

# HELP site_logged_in Logged In Members
# TYPE site_logged_in gauge
site_logged_in 583

Is something like determining highest values even a realistic use case for prometheus?

like image 840
GameCharmer Avatar asked Mar 06 '23 06:03

GameCharmer


1 Answers

max_over_time(site_logged_in[1y]) is the max over the past year, however this presumes that you have a year worth of data to work from.

like image 141
brian-brazil Avatar answered Mar 20 '23 19:03

brian-brazil