Before this work, Prometheus lacked any good and convenient way of visualising and testing the alert rules before it can be used. Requests for the same have been made long ago in these issues #1154 1220, long standing!
It will be added to Prometheus with this PR#4277. Now let's learn more about this.
You will be able to access this tool at
*open images in new tab for a better view*
This is what you will see when you first open.
You will enter your rules here in the same format as your would write your rule file.
After you press
Execute, you will see success/error messages here.
If it was a success, you will see the graphs for the alert expression and
ALERT series simulated over the existing data. Graphs are plotted only for the active alerts.
A simple alerting rule, and hit Execute!
There is 1 active alert, you can see it's info here.
Graph of the expression and the corresponding
ALERT graph. You can see that the alerting rule would save switched between
firing state twice in the current data.
Example for errors
Error in template variables.
Stay tuned, it will be added to Prometheus soon!