3

I am monitoring a gauge metrics with Prometheus, and I want to fire a alert message to Slack channel every time this metrics value changes, also alert message should contains the current value of metrics.

I tried this, here is my rules.yml:

- alert: Test
expr: delta(My_Metrics[5m]) != 0
for: 30s
labels:
severity: page
annotations:
summary: '{{$value}}'

For pass on the metrics value from rules.yml to AlertManager, I put {{$value}} in summary, thought it is the value of metrics, but then I figure out it is the result of expr. How can I put metrics value in summary section? or is there any other way to achieve what I expected?

cece2048
  • 1,121
  • 2
  • 11
  • 17

0 Answers0