【问题标题】:Trigger alert in prometheus/grafana for timestamp from node-exporter too old在 prometheus/grafana 中触发节点导出器的时间戳太旧的警报
【发布时间】:2020-01-08 13:09:01
【问题描述】:

我们已经运行了 node_exporter,我正在使用文本文件收集器让我输入作业修改的文件的时间戳。

指标输出:

# 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

所以我们已经成功地在 prometheus 中收集了它。我和我的舞会家伙遇到的问题是,对于 prometheus 和 grafana 来说都是新手,如何编写查询以触发警报,如果

current-epoch-time - job_timestamp_file > 86400

这真的看起来应该很容易......

【问题讨论】:

    标签: grafana prometheus prometheus-node-exporter


    【解决方案1】:

    time() - job_timestamp_file > 86400

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

    【讨论】:

      猜你喜欢
      • 2021-02-20
      • 1970-01-01
      • 2021-05-08
      • 2022-07-30
      • 2021-02-23
      • 1970-01-01
      • 2021-04-26
      • 2021-05-27
      • 1970-01-01
      相关资源
      最近更新 更多