NatureWhistle. Notification
(nature_whistle v0.3.0)
Copy Markdown
Message formatting and asynchronous delivery orchestration.
NatureWhistle.EventHandler decides when a notification should happen.
This module decides how the notification is formatted and which delivery
profiles should receive it.
The dispatch path works in three stages:
- choose the alert message or calm message template
- format the current value for human-friendly display
- queue delivery tasks for the matching notifier profiles
The actual HTTP or console delivery logic lives in the notifier modules under
NatureWhistle.Notifier.*.
Summary
Functions
Formats and dispatches a notification for the given alert.
Functions
Formats and dispatches a notification for the given alert.
Parameters:
alert- the normalized alert map loaded from ETSvalue- the current measurement value that triggered the notificationmetadata- telemetry metadata forwarded to the notifier implementationtype- either:alertor:calm
The function:
- selects
alert_messagefor:alertorcalm_messagefor:calm - formats the value using the alert's
formatter, if one exists - replaces
%{value}in the message template - loads
:notifiers_configfrom application env, falling back to console - matches alert profile names from
alert.notifiersagainst the global notifier profiles byname - spawns an asynchronous task for each matching built-in notifier service
If no notifier profile matches, nothing is dispatched and a warning is logged.