@Yaxi Zhang Welcome to Microsoft Q & A Community Forum. From the information provided, I assume that you are using older version of Grafana which is why you are seeing the notification "Grafana legacy alerting is going away soon". I would suggest you upgrade the Grafana to latest version which provides you with new unified alerting system.
For your reference, providing the articles of legacy alerting and new unified alerting system.
- Legacy Alerting : https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/
- New Unified Alerting System: https://grafana.com/docs/grafana/latest/alerting/migrating-alerts/