简体   繁体   English

特定时期的 Prometheus 计数查询

[英]Prometheus count query for a particular period

How can I get the Prometheus metrics count for a particular day ?如何获取特定日期的 Prometheus 指标计数? For eg: I would need it for 24 hours, for the day 13-10-2020.例如:我需要它 24 小时,在 13-10-2020 那天。

All I see is a way to get the count for the last 24 hours:我所看到的只是一种获取过去 24 小时计数的方法:

sum(increase(created_total[24h]))

How could I get the same count over 24 hours, but for a different day ?我怎么能在 24 小时内获得相同的计数,但在不同的一天? 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:从 Prometheus Graph Console 开始,在Moment字段中2020-10-13 23:59:59

Moment field of Prometheus Graph Console Prometheus Graph Console 的矩场

There's a similar way with Graph. 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).有范围(=您要每日统计天数),结束时间戳( 2020-10-13 23:59:59在你的情况下)和分辨率( 86400在你的情况下,24小时以秒为单位)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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