1. Contextual data
A notification has contextual data. Contextual data is comprised of:
- alert definition data
- data involved in the trigger (for example metrics and availability values)
+1
2. Notifier data
2.1 Who is the recipient?
Email: address
SMS: phone number
Sometimes the recipient is fixed (for example when sending email to a
mailing-list).
Sometimes it should be picked from user information (for example when
sending emails to a group of users)
This information depends on the alert definition, but a default should
be configurable for convenience.
2.2 How should the message be sent?
Email: SMTP address/port and credentials
SMS: Web service HTTP URL and credentials
The information depends on the tenant (in rare cases, on the alert
definition, but let's ignore the problem for now)
3. How should the message be formatted?
When a human is the recipient, information can be turned into text with
a template engine (like freemarker).
Information depends on the alert definition, but a default should be
configurable for convenience.
4. Configuration
Notifiers may expose REST endpoints (with standardized URIs)
- default config: /emailnotifier/configuration
- alert definition level config: /emailnotifier/configuration/1
I am not sue if notifiers should expose directly these end-points for the configuration
tasks.
I was thinking in a way where when a plugin is deployed, the plugin configuration is sent
to the alert-engine component.
Then UI or consumers of alerts can access to notifiers info through the
DefinitionService.
In practice, flow would be similar, but instead to use specific /emailnotifier/ just using
a centralized by alerts /hawkular/alerts/notifier/email/....
Example:
{
"to": ["paul(a)foobar.com", "alfred(a)foobar.com"],
"cc": ["backoffice-mw-ops(a)foobar.com"],
"subject": "Pool soon exhausted",
"mode": "plaintext+html"
"templates":
[{
name: "plaintext",
uri: "/emailnotifier/configuration/1/templates/plaintext"
},{
name: "html",
uri: "/emailnotifier/configuration/1/templates/html"
}]
}
- template configs:
Example:
/emailnotifier/configuration/1/templates/plaintext
/emailnotifier/configuration/1/templates/html
I'm still not sure which component should be responsible of loading user
information when a user (or a group of users) is selected as the recipient.
Good question, my main doubt if it is notifier plugin should be responsible to know this
info by itself or it has to call a third-party component for that.
5. Process
- Alerts sends contextual data on the bus
- Notifier picks it up
- Notifier loads configuration for this alert definition or the default one
- Notifier applies the template (optional)
- Notifier sends email or invoke sender API
+1
6. Storage
There needs to be some shared storage where to bind configuration and
templates to alert definitions.
+1
We raised this concern before and if I am not wrong idea is to use H2 at this stage and
change in the future.
Comments?
Regards,
Thomas
_______________________________________________
hawkular-dev mailing list
hawkular-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev