I'd like to query prometheus to show when Alerts start and end. I want to either create a graph or table in grafana with these metrics.
I can use ALERTS{alertstate="firing"} == 0 to determine when alerts stop firing. changes(ALERTS{alertstate="firing"} [2m]) > 0 gives me a similar result.
However I haven't figured out a way to create a query to show the start of an alert.
I think I figured out that I can use count_over_time(ALERTS [1m]) < 4 in my environment to show both the start and end of alerts but I need to be able to distinguish between the start and end.
Any ideas on how to do this?
William