Notification Plugin should provide interface which accepts the Eagle Alert Entity and return Status of the same.
Today in Eagle there is no Notification Plugin Framework where users can implement the Notification Plugin Interface and upload their own library. This Plugin allows user to implement their own and also provides below default implementation
- Sending Email Alert
- Persisting Message to Kafka
- Writing Entities to Eagle Service
Notification Interface:
At the time of Eagle Topology starts , Code should scan and register the Notification Type ( Custom Notification / Email / Kafka Message etc.. ). Since Eagle allows users to implement their own Notification Implementation , Our Topology Init code should automatically detects and register which type of Notification needs to be used .
public class MessageNotification implements NotificationPlugin {
}
When users deploys their code with Eagle Service , Our Topology Initializer have to detect MessageNotification and Register it automatically.
How to select Notification When defining Policy ?
Eagle should allow users to select the Notification Type at the time of Policy Creation.. For that we need to persist the detected policies in HBase and Provide API on Top of It to Query.
To ensure the consistency always delete the Notification Table and Recreate with detected Notifications.
Persisting Message to Kafka:
Email Alert Notification:
In Email Alert Notification API implementation ,
public class EmailNotification implements NotificationPlugin {
@Override
public void onAlert(AlertAPIEntity alertEntity) {
// call Executor Service to build email and send alert in Async Way
}
@Override
public NotificationStatus getStatus() {
return null;
}
Generic Notification Service :
It would be nice to have the Generic Notification Service API which accepts alert from any Monitoring System like Eagle , Zabbix and forward to External Systems.
How to accept alerts from Monitoring System ?:
Framework will expose Rest Service to external world where clients can post their messages.