[英]Grafana + Prometheus how to use regex in query metrics?
我们正在动态添加新指标。 是否可以在 Grafana 查询指标中使用正则表达式?
application_test_total{color="0"}
application_test_total{color="1"}
application_test_total{color="2"}
如何避免这种情况?
sum(application_test_total{color="0"})+sum(application_test_total{color="1"})
可以用这个代替吗?
application_test_total{color="[0-9]{2}"}
您可以替换:
sum(application_test_total{color="0"})+sum(application_test_total{color="1"})
到:
sum(application_test_total{color=~"[0-9]{1}"})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.