Alert message summary

In the alert message, vars look like that:
summary = {{ deployment }} is not available for 10 minutes
The name of the var appears instead of the value
In the query Legend:{{deployment}} works
How can I print the value of deployment?
Metric: kube_deployment_status_replicas_unavailable


try this {{ $values.deployment }} where “deployment” is the name of the query.

Not working -
summary = {{values.kube_deployment_status_replicas_unavailable .deployment}} is not available for 10 minutes
What do you mean by query name? - the metric name?

I think you forgot the dollar sign $

By the query name I meant this:



Can you show what results gives the query using this metric? Is the deployment a label? I thought it was a query name when I first read your message…

If this is the case, try this

{{ $values.<replace_with_query_name>.Labels.deployment }}


{{ $labels.deployment }}

I attached the queries and the summary description
the message I get
summary = [no value] is not available for 10 minutes - [no value]

You see, there is 2 variables in the alert section;

“$labels” gives you all the labels that are availables.
“$values” gives you all the values of all queries.

In your alert, there is a label called “deployment”, you can access it using the “$labels” variable:

{{ $labels.deployment }}

or, access the value of the query “A”, and then its labels:

{{ $values.A.Labels.deployment }}