所有计数器加一个标签-普罗米修斯



大家好,我有一个错误计数器,它给了我如下指标,我想得到过去7天内每个错误原因的总和。我试过使用增加,但似乎增加函数不支持by/without操作符,所以我得到的结果包括machine_type

查询结果中如何不包含machine_type?

{instance="localhost:8000", job="prometheus", reason="Some_reason", machine_type="gpu"}

这是我试过的increase(error_count_total[24h])结果是

{instance="localhost:8000", job="prometheus", reason="Some_reason", machine_type="gpu"}: 15
{instance="localhost:8000", job="prometheus", reason="Some_reason", machine_type="cpu"}: 10

我想得到

{instance="localhost:8000", job="prometheus", reason="Some_reason"}: 25

尝试以下查询:

sum without (machine_type) (increase(error_count_total[24h]))

最新更新