简体   繁体   中英

Prometheus count query for a particular period

How can I get the Prometheus metrics count for a particular day ? For eg: I would need it for 24 hours, for the day 13-10-2020.

All I see is a way to get the count for the last 24 hours:

sum(increase(created_total[24h]))

How could I get the same count over 24 hours, but for a different day ? I spent quite some time trying to figure out a way but with no luck. Any pointers?

Start with Prometheus Graph Console and punch in 2020-10-13 23:59:59 into the Moment field:

Moment field of Prometheus Graph Console

There's a similar way with Graph. There's range (=number of days for which you want daily stats), end timestamp ( 2020-10-13 23:59:59 in your case) and resolution ( 86400 in your case, for 24h in seconds).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM