回到Graph 页面,可以使用 probe_duration_seconds{job="ping"} 来查看检测的时间,这样就实现了对 ICMP 的黑盒监控。我们再创建一个用于检测网站 HTTP 服务是否正常的任务:# blackboxExporter-probeDomain.yaml apiVersion: monitoring.coreos.com/v1 kind: Probe metadata: name: domain-probe namespace: ...
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { duration := time.Now().Sub(started) if duration.Seconds() > 10 { w.WriteHeader(500) w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds())) } else { w.WriteHeader(200) w.Write([]byte("ok")) }...
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {duration :=time.Now().Sub(started)if duration.Seconds() > 10 {w.WriteHeader(500)w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds()))}else{w.WriteHeader(200)w.Write([]byte("ok"))}}) 1. 2. 3....
另外除了上面的initialDelaySeconds和periodSeconds属性外,探针还可以配置如下几个参数: timeoutSeconds:探测超时的秒数。默认为1秒。最小值为1。 initialDelaySeconds:启动活动或准备就绪探测之前容器启动后的秒数。 periodSeconds:执行探测的频率(以秒为单位)。默认为10秒。最小值为1。 failureThreshold:当Pod启动并且探...
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { duration := time.Now().Sub(started) if duration.Seconds() > 10 { w.WriteHeader(500) w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds())) }
Duration between probe operations, in seconds. httpVersion 10-character string HTTP server version. Used with HTTP probes. icpifAdvantage 32-bit integer Used in Jitter probe ICPIF calculations. name 32-character string Name of the probe. nativeType 32-character string A human-readable textua...
core.halt(Duration::from_millis(100)) .context("Halting failed")?; let mut read_results = Vec::<f64>::with_capacity(iterations); let mut write_results = Vec::<f64>::with_capacity(iterations); 'inner: for _ in 0..iterations { let write_throughput = test.block_write(&mut core)?
* TCP probe timeout duration: N/A (probes will fail once the configured probe interval duration has passed and the next probe has been sent) * HTTP/S probe timeout duration: 30 seconds For HTTP/S probes, if the configured interval is longer than the above timeout period, the health pro...
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {duration := time.Now().Sub(started)if duration.Seconds() > 10 {w.WriteHeader(500)w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds()))} else {w.WriteHeader(200)w.Write([]byte("ok"))}}) 容器...
// pkg/kubelet/prober/worker.go:145// run periodically probes the container.func(w*worker)run(){ctx:=context.Background()probeTickerPeriod:=time.Duration(w.spec.PeriodSeconds)*time.Second//...probeTicker:=time.NewTicker(probeTickerPeriod)deferfunc(){// Clean up.probeTicker.Stop()if!w.cont...