We want to create a dashboard to see the alert history in time series.
Currently, what we were able to get a simple alert list using the alert list dashboard as the image shows
However, we would like to show that same alert history as a time series. We have a query that goes like this:
from=“state-history”} | json | label_format status=`{{if contains “Alerting” .current}} 1 {{else}} 0 {{end}}
So that if the alert has been triggered it’s changed by 1, and 0 if it hasn’t been triggered. In transformations we are changing the status tu number. However, we get only one line when we should be having one line per each alertname.
Is there a way to achieve this? Thanks!