我有一个prometheus警告表达式的直方图摘要,表达式为
histogram_quantile(0.95, sum(increase(event_bucket{source="current"}[5m])) by (le, mode)) > 30 它可以使用各种mode=产生结果,例如:
{mode="ABC"} 38.4
{mode="XYZ"} 39.3
我可以在注释描述、摘要中使用上面的结果模式来解释我收到此警报的哪种模式?
annotations:
description: event bucket of mode - - -(whatever modes we would receive from result) - - - are greater than 30.
summary: summary of same请指点,因为我是新手。
谢谢!!
发布于 2021-06-14 13:18:37
使用以下方法:
description: event bucket of mode {{ $labels.mode }} is {{ $value | printf "%.2f" }} and is greater than 30.发布于 2021-06-14 12:51:27
有一种方法是用{{ $labels }{ $value }}回答同样的问题。
annotations:
description: event bucket of mode {{ $labels }} and threshold is {{ $value }} are greater than 30.
summary: summary of same根据结果,可以创建许多警报。

可能有几个解决方案存在,这就是我发现的解决上述问题的方法。
继续学习,继续分享。谢谢
https://stackoverflow.com/questions/67970083
复制相似问题