Alerts on graph panel grafana using elasticsource datasource

hi, how to display alerts on graph panels with elasticsearch datasource in grafana
for example, if the success rate drops to 30% then the alert color will be red, if the successrate is 30% <X <= 70% then the alert color will turn yellow, and if the successrate is above 70% then the alert color is green
and how to display the history of alerts when it goes down to yellow, or when it goes down to red.