使用时间序列中最新数据点值的值注释警报

时间:2019-06-25 19:06:07

标签: templates prometheus alerts

我想使用模板将在Prometheus中触发警报的时间序列中的最新值添加到描述中。警报规则中的模板 $ value 变量表示所评估表达式中的值,而不是时间序列中的值。

基本上,我正在尝试执行以下操作:

annotations:
  summary: "A service in {{$labels.env}} environment failed"
  description: "Service {{ $labels.service_name }} failed at time: {{ $timeseries_name.value | humanizeTimestamp}}"

这可能吗?如果可以,怎么办?

0 个答案:

没有答案