[英]How to get average over time only when PC is up in Prometheus
I'm currently trying to get the average amount of free RAM in the last week on a Windows PC, using the WMI Exporter ( https://github.com/martinlindhe/wmi_exporter ) and Prometheus with the following query : 我目前正在尝试使用WMI导出器( https://github.com/martinlindhe/wmi_exporter )和Prometheus并在Windows PC上获得上周平均可用RAM的平均值,并带有以下查询:
avg_over_time(wmi_os_physical_memory_free_bytes{instance="foo"}[1w])
The query inside "avg_over_time" is working correctly, but the problem is the PC is not up 24/7. “ avg_over_time”内的查询正常运行,但问题是PC没有24/7正常运行。 Since I can't have holes in a range, I was considering the idea of using a recording rules.
由于我无法在某个范围内打洞,因此我正在考虑使用记录规则的想法。
The other problem is that the PC doesn't start and stop at known values, so I can't use the following solution : How to get the average over time only during the day in Prometheus because I can't tell the time of the day I need to start collecting. 另一个问题是PC不会以已知值启动和停止,因此我不能使用以下解决方案: 如何仅在白天在Prometheus中获取一段时间内的平均值,因为我无法告知时间我需要开始收集的一天。
Is there any recording rule that could concatenate all the information gathered only during the up time of the pc ? 是否有任何记录规则可以将仅在计算机正常运行期间收集的所有信息连接起来?
Thanks in advance. 提前致谢。
上面的表达式已经avg_over_time
您的要求,因为在无法刮除目标并且avg_over_time
不会做任何想做的事情之前,没有任何数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.