Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to monitor Application gateway and trigger an alert.
For platform related errors, you can configure "Azure Resource Health".
For Backend related errors (where client gets a 4XX or 5XX error)
The metric to use here is "Response status (4xx, 5xx) crosses threshold" and create an alert when the client gets a abnormally more number of such responses
Refer : App Gateway Alerts
You should observe the gateway in production to determine static threshold or use dynamic threshold for the alert.
Kindly let us know if the above helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.