要查询网络丢包率,您需要使用 node-exporter 中的 node_network_receive_errs_total 和 node_network_receive_packets_total 指标。
node_network_receive_errs_total 表示接收时出错的数据包数量,而 node_network_receive_packets_total 表示接收到的总数据包数量。因此,可以通过计算这两个指标之间的比例来获取网络丢包率:
1 - (node_network_receive_packets_total{device="eth0"} - node_network_receive_errs_total{device="eth0"}) / node_network_receive_packets_total{device="eth0"}
其中,device="eth0" 是用于筛选特定网卡(例如,您可能有多个网卡)。
您可以使用 Prometheus 的查询语言(PromQL)在 Grafana 中执行此查询,并将其添加到仪表板中以监视网络丢包率。




