I have a label cs_job_time
in Prometheus/Alert Manager and would like to send an email alert when a condition is met for another job. The email sends fine but is it possible to include the value of cs_job_time
within the email? I can use {{$value}}
for the metric in question but I would also like to print the value of cs_job_time
.
I came across this but when I try
time = "{{ `cs_job_time{instance='%s', job='/'}` $labels.instance | query | first }}
or similar variants, I get the error message "Error expanding alert template CSJobAlert with data '{map[] 2123}': runtime error: invalid memory address or nil pointer dereference" source="alerting.go:199"
Is it possible to email metric values?