title: How to make Prometheus alert description give both ratio and absolute numbers?
body: <p>I currently have a Prometheus alert that fires when my success rate drops below 85%.</p>
  
  <p>I would like to add the absolute numbers of the ratio to the alert description.  How do I do that?</p>
  
  <p>My YAML currently looks like this (I cleaned up some extraneous details):</p>
  
  <pre><code>groups:
    - name: recording_rules
      rules:
      - record: number_of_successes_24h
        expr: avg(sum by(instance)(my_status{kubernetes_name="my-prom",timeRange="1d",status=~"success"}))
      - record: number_of_total_24h
        expr: avg(sum by(instance)(my_status{kubernetes_name="my-prom",timeRange="1d"}))
      - record: success_rate_24h
        expr: clamp_max(number_of_successes_24h / number_of_total_24h * 100, 100)
  
    - name: alerting_rules
      rules:
      - alert: LowSuccessRate24H
        expr: success_rate_24h &lt; 85
        labels:
          severity: critical
        annotations:
          summary: "CRITICAL: Low success rate 24h"
          description: "Success rate in the last 24 hours went below 85% (value: {{ $value }}%)"
  </code></pre>
  
  <p>My question is, how do I add the <code>number_of_successes_24h</code> and <code>number_of_total_24h</code> into the description?<br>
  I read the official documentation at <a href="https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/" rel="nofollow noreferrer">https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/</a>, but I got lost; I searched SO, but I didn't find anything relevant.</p>
  
  <p>I read that there were extra details available in <code>$labels</code>, so I tried printing that as an example to see what was in it, but I got <code>map[__name__:success_rate_24h]</code>, and I couldn't figure out how to see inside that.</p>
  
  <p>Partial answers and guides welcome.  Thanks.</p>