简体   繁体   English

PromQL - Prometheus - 查询值为 label

[英]PromQL - Prometheus - query value as label

Some query returns:一些查询返回:

{id="cart"}     0.014961101137043577
{id="payment"}  0.014961101137043577
{id="products"} 0.013670539986329524

But I would like to have:但我想拥有:

{id="cart", a="0.014961101137043577"}     1
{id="payment", a="0.014961101137043577"}  1
{id="products", a="0.013670539986329524"} 1

I've looked everywhere, but I am worried that this is not possible;/我到处看了,但我担心这是不可能的;/

I found something interesting, it is kind of hack:我发现了一些有趣的东西,它有点像 hack:

count_values without() ("my_new_label", start_metric)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM