I have alerts setup on Prometheus where there are different jobs in the alert.I want to find how many times the alert was fired over last week, given the job name.So there is a alerts name "A" and there are multiple jobs "B","C","D" under that, I want to know how many times alert "A" was fired for job "B" in last week.
If I use following expression :
sum by(alertname) (changes(ALERTS_FOR_STATE[1w]))
It gives me total alerts fired in last week but since there are multiple jobs in that, I am not able to figure out how to get count only for specific job.
I would like to know if there is some other way to achieve same thing?
question from:
https://stackoverflow.com/questions/65617748/prometheus-get-count-of-up-metric-0-for-give-alert 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…