不能对普罗米修斯集群外的服务进行健康检查

时间:2017-12-07 13:17:27

标签: kubernetes prometheus kubernetes-health-check

我已经安装了prometheus和blackbox来监控kubenetes集群,它正好适用于dservice监控,这对所有服务的探测成功很好,但是来自外部的服务,我无法监控那些服务。例如:google.com,它给出probe_status:0和probe_http_redirects:0

Blackbox目标数组是:

   {
   "targets": [ "google.com" ],
   "labels": {
       "job": "kubernetes-services",
       "namespace": "default"
   }

}

工作:

- job_name: 'kubernetes-services'
  scheme: http
  metrics_path: /probe
  params:
    module: [http_2xx]
  file_sd_configs:
    - files:
      - /etc/prometheus/blackbox-targets.json
  relabel_configs:
  - source_labels: [__address__]
    target_label: __param_target
    replacement: ${1}
  - source_labels: [__param_target]
    regex: (.*)
    target_label: instance
    replacement: ${1}
  - source_labels: []
   regex: .*
   target_label: __address__
   replacement: mo-blackbox.mo-system:9115

结果:

probe_ip_protocol 6
probe_http_status_code 0
probe_http_content_length 0
probe_http_redirects 0
probe_http_ssl 0
probe_duration_seconds 0.373322
probe_success 0

我想要probe_success和probe_http_redirects应该是1,我该如何实现呢?

0 个答案:

没有答案