[英]PromQL/prometheus query label_replace() multiple
試圖用普羅米修斯查詢找到一種方法來替換 2 個或更多標簽,但沒有找到任何好的和“簡短”的方法。
這是我所擁有的:
label_replace(
label_replace(
label_replace(
label_replace(
rate(spring_integration_send_seconds_count{result!="success", application="MyApplicationName"}[1m])
,"service", "$1", "name", "(.*).ConsumerEndpointFactoryBean.*"
)
, "service", "$1", "name", "(.*).channel.*"
)
, "service", "$1", "name", "(.*).Channel.*"
)
, "service", "$1", "name", "(.*).handler.*"
)
)
是否有更短/更簡潔的方法來替換標簽?
在我的示例中,有 4 種情況我想“跳過”結尾,當 label 值的結尾是:
沒關系,這只是正則表達式的問題
label_replace(
rate(spring_integration_send_seconds_count{result!="success", app="MyApplicationName"}[1m])
,"service",
"$1",
"name", "(.*).(channel|Channel|handler|ConsumerEndpointFactoryBean).*"
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.