Prometheus 按标签列出的普罗米修斯百分比
我正试图从未达到指标中获得失败的百分比Prometheus 按标签列出的普罗米修斯百分比,prometheus,micrometer,Prometheus,Micrometer,我正试图从未达到指标中获得失败的百分比 function_counter_total{name="getCar", status="fail"} function_counter_total{name="getCar", status="emit"} 使用prometheus查询function\u counter\u total{status=“fail”}/function\u counter\u total{status=“emit”}buy return'No datapoints f
function_counter_total{name="getCar", status="fail"}
function_counter_total{name="getCar", status="emit"}
使用prometheus查询
function\u counter\u total{status=“fail”}/function\u counter\u total{status=“emit”}
buy return'No datapoints found'。这不是导出度量的推荐方法,因为a)在ProMQ中使用它比较困难,b)标签应该是空间上的分区(假设emit是fail的超集,如果不是,那么您要求执行的计算可能不是您想要的)。将函数\u total
和函数\u failed\u total
计数器分开会更好
如果您必须使用此表单中的度量,您可以这样做
function_counter_total{status="fail"}
/ ignoring(status)
function_counter_total{status="emit"}