How can I quickly debug variables?

How can I quickly debug variables? If I want to check the value of an alert variable, I have to trigger the alert first and then check the value in the email. Is there a faster way to debug?

  • my version: 9.3.0

If an alert is firing / in pending state, you can go see alert state history to check what are the labels associated with the instance that’s firing and adjust your template accordingly.

Thank you very much for your response, but the solution you provided still requires triggering the alert first to debug it, while my expectation is to debug template variables without triggering the alert.

Its not possible afaik, because these label values will be present only when the alert triggers, i.e values will be known only after grafana evaluates the specified promql expression in your rule.

If you wanna debug, you can simply run the alert expression in grafana explore and see what are the labels that are returned.

.Labels are the labels returned by the promql expression.

The other option I see is, duplicate this template, create another notification contact point, use there and route your alert there to test.