我必须在grafana上查询普罗米修斯:
首先延迟:
mtr_latency{quantile=~"$quantile",alias=~"$mtr_endpoint",instance=~"$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"}
第二个已发送包裹:
mtr_sent{alias=~"$mtr_endpoint",instance=~"$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"}
如何解决将两个指标相除的查询:
(mtr_latency{quantile=~"$quantile",alias=~"$mtr_endpoint",instance=~"$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"}/mtr_sent{alias=~"$mtr_endpoint",instance=~"$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"})
谢谢!
答案 0 :(得分:0)
有结果,但是没有显示实际的地铁数据:
(sum(mtr_latency{alias=~"$mtr_endpoint",instance="$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"}) by (instance, alias, hop_id, hop_ip))/(sum(mtr_sent{alias=~"$mtr_endpoint",instance="$instance",hop_id=~"$hop_id",hop_ip=~"$hop_ip"}) by (alias,instance,hop_id,hop_ip))