Prometheus电子邮件警报以显示指标值

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?

You're missing the printf there from the example:

"{{ printf `cs_job_time{instance='%s', job='/'}` $labels.instance | query | first }}"

Be careful though, if there's no results then the first will fail. It's generally best to use a range statement as that'll be resilient to that.