简体   繁体   English

在prometheus / grafana中触发警报,提示来自节点导出器的时间戳太旧

[英]Trigger alert in prometheus/grafana for timestamp from node-exporter too old

We've got node_exporter running, and I am using the textfile collector to let me put in a timestamp of a file modified by a job. 我们已经运行了node_exporter,并且我正在使用文本文件收集器来放入由作业修改的文件的时间戳。

The metrics output: 指标输出:

# HELP job_timestamp_file Metric read from /usr/local/etc/node_exporter/job-timestamp.prom
# TYPE job_timestamp_file untyped
job_timestamp_file 1.567657381e+09

So we've successfully collected that in prometheus. 因此,我们已经成功地将其收集到了普罗米修斯。 What my prom guy and I are having problems with, both being pretty new to prometheus and grafana, is how to write the query to trigger an alert if 我的舞会家伙和我遇到的问题(都是Prometheus和grafana的新手)是如何编写查询以触发警报

current-epoch-time - job_timestamp_file > 86400 当前时间-job_timestamp_file> 86400

Which really seems like it ought to be easy... 似乎真的应该很容易...

time() - job_timestamp_file > 86400

节点导出器还公开了它通过文本文件收集器读取的文件的mtime。

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

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