Foglight does not support monitoring an availability group via the listener. Each node in availability group should be monitored separately.
Issues would include the following when monitoring by the listener
- The failover alarm will not work properly
- Since the primary and secondary are different instances and machines
- Confused topology: the data from different instances will be mixed - so it will become problematic to look at historical data since you never know to which instance it is related
- OS monitoring - For example, when Foglight monitors instance "a" on machine "a" after a failover to instance "b" on machine "b", if the environment is monitored by the listener DB metrics would belong to instance "b" but the OS to machine "a"
- It is recommended to monitor each instance node separately to make sure that all nodes(machines) and DB instances are healthy and available for failover
Unlike a failover cluster, with Availability Groups an instance can serve as secondary for one AG and primary on another. As well, since some databases are part of an Availability Group on an instance it does not mean all databases are part of it. Hence each instance should be monitored separately.