title: How to store the status of an expr in alert rules to use that in annotations?
body: <p>I am setting up alerts for prometheus for whenever a node goes in "NotReady" my Kubernetes cluster. I get notified on Slack whenever that happens. The problem is I get notified with the same description "Node xxxx is in NotReady" even when it comes back up. I am trying to use a variable for the ready status of the node and use that in the annotations part.</p>
  
  <p>I have tried using "vars" and "when" to assign it to a variable to use it in annotations.</p>
  
  <pre><code>  - name: NodeNotReady
      rules:
      - alert: K8SNodeNotReadyAlert
        expr: kube_node_status_condition{condition="Ready",status="true"} == 0
        for: 3m
        vars:
        - ready_status: "Ready"
          when: kube_node_status_condition{condition="Ready",status="true"} == 1
        - ready_status: "Not Ready"
          when: kube_node_status_condition{condition="Ready",status="true"} == 0
        labels:
          severity: warning
        annotations:
          description: Node {{ $labels.node }} status is in {{ ready_status }}.
          summary: Node status {{ ready_status }} Alert!  
  </code></pre>
  
  <p>I want to get these alerts : 
  1. When node is NotReady: "Node prom-node status is in NotReady."
  2. When node is Ready: "Node prom-node status is in NotReady."</p>