我想使用模板将在Prometheus中触发警报的时间序列中的最新值添加到描述中。警报规则中的模板 $ value 变量表示所评估表达式中的值,而不是时间序列中的值。
基本上,我正在尝试执行以下操作:
annotations:
summary: "A service in {{$labels.env}} environment failed"
description: "Service {{ $labels.service_name }} failed at time: {{ $timeseries_name.value | humanizeTimestamp}}"
这可能吗?如果可以,怎么办?