Prometheus查询以提醒是否发生X时间在一个时间段?
我正在研究一个查询,如果磁盘队列长度经常超过2,则应提醒该查询。说,如果发生在1d时期的10次。
我似乎无法围绕这个问题。我首先需要问题的次数,因此: count(windows_logical_disk_requests_queued> 2)
然后,我需要检查此查询在最后一维发生了多少次。我该怎么做?
I'm working on a query that should alert if the disk queue length gets above 2 frequently. Say, if it happens 10 times over a 1d period.
I can't seem to get my head around this one. I would first need the amount of times the issue occurs, so:count(windows_logical_disk_requests_queued > 2)
Then I'd need to check how many times this query occurred over the last 1d. How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 count_over_time 。像:
count_over_time(windows_logical_disk_requests_queed [1d])> 10
You can use count_over_time. Something like:
count_over_time(windows_logical_disk_requests_queued[1d]) > 10