Is it possible to setup an alert on a Availability Group's estimated data loss, so, when the estimated data loss is greater than x seconds or minutes, an alert is sent?
Absolutely - do you have a favorite query to get the statistical value for estimated data loss? (I've seen a few out there online)
Ah, no. Isn't it possible to use the data already collected by DPA? DPA already has an estimated data loss for each database in the secondary replicas. I'd like to see if we can alert from that data.
OK, I just set this up in a lab env., we sample every 4 minutes for that particular data, so you'd want the alert to mimic that interval.
Create a custom alert (single numeric) and query against the repo for whatever instances/AGs you want to alert on.
select est_data_loss from con_ag_database
Set your thresholds as you want. The units should be in seconds.
I really like the idea of doing this, so posted under our custom alert content: Custom Alert - AG Data Loss Alert
Feel free to comment or let me know if you fancy it up!