Prometheus 样式的监控
Prometheus 样式的"smokeping"探测器。
此探测器会向目标发送一系列 ICMP (或 UDP) ping 请求,并将响应记录到 Prometheus 的直方图指标中。
…探针可以从命令行或 yaml 配置文件中获取目标和参数列表。 配置示例:
---
targets:
- hosts:
- host1
- host2
interval: 1s # Duration, Default 1s.
network: ip # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation)
size: 56 # Packet data size in bytes. Default 56 (Range: 24 - 65535)
source: 127.0.1.1 # Souce IP address to use. Default: None (automatic selection)在每个主机组中,interval,network 和protocol 是可选的。
间隔 Duration 采用 Go time.ParseDuration() 语法。
启动时会读取配置文件,并且可以通过 SIGHUP 信号或通过对 URI 路径 /-/reload 发送 HTTP POST 重新加载配置文件。
需要 Go >= 1.22
go install github.com/SuperQ/smokeping_prober@latest
sudo setcap cap_net_raw=+ep ${GOPATH}/bin/smokeping_prober在多 CPU 系统中,通常更有效地将探测器限制在一个 CPU 上,以减少跨 CPU 的上下文切换次数和从内核到探测器的数据包复制次数。这可以通过 GOMAXPROCS 环境变量或使用容器 (cgroup) 限制来实现。
| 指标名称 | 类型 | 描述 |
|---|---|---|
| smokeping_requests_total | 计数器 | 发送的ping请求数。 |
| smokeping_response_duration_seconds | 历史图表 | ping响应持续时间。 |
| smokeping_response_ttl | 计数器 | 最后一个响应的时间到期时间(TTL)。 |
| smokeping_response_duplica |
暂无开放 Issues,或尚未同步最近议题。