本文介绍了Prometheus/PromQL 减去两个规范指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有来自两个不同实例的这个仪表指标metric_awesome".我想要做的是,像这样从实例二中减去实例一
I have this gauge metric "metric_awesome" from two different instances.What i want to do, is subtract instance one from instance two like so
metric_awesome{instance="one"} - metric_awesome{instance="two"}
不幸的是,结果集是空的.有没有人经历过这个?
Unfortunately the result set is empty. Has anyone experienced this?
推荐答案
这里的问题是标签不匹配.你想要的是:
The issue here is that the labels don't match. What you want is:
metric_awesome{instance="one"} - ignoring(instance) metric_awesome{instance="two"}
这篇关于Prometheus/PromQL 减去两个规范指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!