Prometheus query to get the value of a metric since midnight or a dynamic offset

Viewed 679

I am exporting a gauge metric named order_count to Prometheus and updating its value every 2 mins. I want to plot a Grafana graph about how many orders have been received since midnight of the same day. I know the offset can be calculated by time() % 86400 as in the number of seconds since midnight but prometheus does not accept dynamic offset values as follows

order_count - order_count offset (time() % 86400)s

How could I achieve the same. ? Any help would be greatly appreciated.

0 Answers
Related