rules:-alert: 黑盒子探测失败告警expr: probe_success ==0for: 1m labels: severity: critical annotations: summary:"黑盒子探测失败{{ $labels.instance }}"description:"黑盒子检测失败,当前值:{{ $value }}"-alert: 请求慢告警expr: avg_over_time(probe_duration_seconds[1m]) >1for: 1m labels: sev...
1.业务正常性 icmp、tcp、http、post 监测是否正常可以观察probe_success 这一指标 probe_success == 0 ##联通性异常 probe_success == 1 ##联通性正常 告警也是判断这个指标是否等于0,如等于0 则触发异常报警 告警规则可以如下配置: cat >/data/Software/prometheus-2.28.1.linux-amd64/rules/Blackbox-Exporte...
回到Graph 页面,可以使用 probe_success{job="kubernetes-service-dns"} 来查看检测结果,这样就实现了对 DNS 的黑盒监控。 除了DNS 的配置外,上面我们还配置了一个 http_2xx 的模块,也就是 HTTP 探针,HTTP 探针是进行黑盒监控时最常用的探针之一,通过 HTTP 探针能够对网站或者 HTTP 服务建立有效的监控,包括其...
probe_success{job="blackbox-http"} == 0 and on(job) time() - max_over_time(probe_success[30m]) > 300for:5mlabels:severity:criticalannotations:runbook:"https://wiki.example.com/blackbox-troubleshooting" 六、避坑指南:生产环境常见问题 DNS缓存污染 现象:偶发性解析失败 解决方案: dns_config:na...
probe_success == 0 ##联通性异常 probe_success == 1 ##联通性正常 告警也是判断这个指标是否等于0,如等于0 则触发异常报警 image.png 2、通过 http 模块我们可以获取证书的过期时间,可以根据过期时间添加相关告警 probe_ssl_earliest_cert_expiry :可以查询证书到期时间。 image.png 经过单位转换我们可以得到一...
http.HandleFunc(path.Join(*routePrefix, "/probe"), func(w http.ResponseWriter, r *http.Request) { sc.Lock() conf := sc.C sc.Unlock() prober.Ha...
1、probe_success指标可以判断我们的 icmp、tcp、http、post 监测是否正常。值为 1 正常,0不正常。 2、probe_http_status_code指标可以知道某个http请求返回的响应码。 3、probe_ssl_earliest_cert_expiry指标可以知道ssl证书何时过期。 三、参考链接 1、blackbox_exporter的下载地址 ...
probe_success == 0 ##联通性异常 probe_success == 1 ##联通性正常 告警也是判断这个指标是否等于0,如等于0 则触发异常报警 image.png 2、通过 http 模块我们可以获取证书的过期时间,可以根据过期时间添加相关告警 probe_ssl_earliest_cert_expiry :可以查询证书到期时间。
在默认情况下HTTP探针只会对HTTP返回状态码进行校验,如果状态码为2XX(200 <= StatusCode < 300)则表示探测成功,并且探针返回的指标probe_success值为1。 如果用户需要指定HTTP返回状态码,或者对HTTP版本有特殊要求,如下所示,可以使用valid_http_versions和valid_status_codes进行定义: ...
打开Prometheus 的 Target 页面,就会看到 上面定义的 blackbox-k8s-service-dns 任务,到 graph 页面,可以使用 probe_success 和probe_duration_seconds 等来检查历史结果 HTTP 监控(K8S 内部发现方法) 发现Service 监控 代码语言:javascript 代码运行次数:0 运行 AI代码解释 - job_name: 'kubernetes-http-services' ...