【问题标题】:What do the 3 ICMP phases in Prometheus' blackbox exporter mean?Prometheus 的黑盒导出器中的 3 个 ICMP 阶段是什么意思?
【发布时间】:2021-05-06 08:23:03
【问题描述】:
当我们通过 BlackBox 导出器探测数据时,Prometheus 中有 3 个 ICMP 阶段。
- 解决
- rtt
- 设置
每个阶段的目的是什么?
这是一个示例数据集:
probe_icmp_duration_seconds{phase="resolve"} 1.4725e-05
probe_icmp_duration_seconds{phase="rtt"} 0.000237673
probe_icmp_duration_seconds{phase="setup"} 0.000140214
谢谢
【问题讨论】:
标签:
prometheus
icmp
prometheus-blackbox-exporter
【解决方案1】:
对于大多数互联网连接,连接到远程服务通常需要多个阶段,其中包括此类步骤。对于 Prometheus / blackbox,步骤如下:
-
将 DNS 名称(或 IP 地址)解析为可用于向其发送 ICMP 回显请求 (ping) 的 IP 地址。这有一些延迟,具体取决于所使用的 DNS 服务、缓存等。因此,phase="resolve" 的 probe_icmp_duration_seconds 值不为零,但如果 DNS 解析器已经缓存了答案,则通常很小。
-
发送出站请求需要设置套接字。测量此设置过程的时间长度记录在phase="setup" 值中。
-
最后,大多数人真正想要测量的值是从发出传出 ICMP 回显请求的时间点到收到响应的时间点之间的响应时间。这是phase="rtt" 值。