First checkin of fork; modified to also handle alerts as well as metrics