我已经设置了 prometheus 和 blackbox 来监控 kubenetes 集群,它对于 dservice 监控工作正常,所有服务的探测成功都很好,但是来自外部的服务,我无法监控那些服务。例如:google.com,它给出 probe_status: 0 和 probe_http_redirects:0
黑盒目标数组是:
{
"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,我该如何实现呢?