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

时间:2019-09-05 15:31:23

标签: grafana prometheus prometheus-node-exporter

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

指标输出:

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace CalendarReservations {
    public class Program {
        public static void Main(string[] args) {
            CreateWebHostBuilder(args).Build().Run();
        }

        private static IWebHostBuilder CreateWebHostBuilder(string[] args) {
            return WebHost.CreateDefaultBuilder(args)
                .UseIIS()
                .UseStartup<Startup>();
        }
    }
}

因此,我们已经成功地将其收集到了普罗米修斯。我和Prom都遇到了问题,这对于Prometheus和grafana来说都是很新的问题,该如何编写查询以触发警报?

当前时代-job_timestamp_file> 86400

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

1 个答案:

答案 0 :(得分:0)

remove_action( 'wpcf7_init', 'wpcf7_add_form_tag_submit' ); add_action( 'wpcf7_init', 'new_wpcf7_add_shortcode_submit_button',20 ); function new_wpcf7_add_shortcode_submit_button() { wpcf7_add_shortcode( 'submit', 'new_wpcf7_submit_button_shortcode_handler' ); } function new_wpcf7_submit_button_shortcode_handler( $tag ) { ...... }

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