Actions (now part of Notifications)¶
The former actions subsystem — user-authored functions fired on every evaluation whose confirmed severity matched, throttled by a cooldown — has been unified into the one Notifications subsystem, where it is simply a notification with trigger_mode => 'on_state'.
The mapping:
- A per-severity trigger set (
p_on_critical,p_on_ok, …) becomes an explicitp_severities => ARRAY['critical'](or ap_min_severityfloor). Want a different routine per severity result? Register oneon_statenotification per severity —ARRAY['critical'] → f_critical,ARRAY['ok'] → f_ok. - The inline function becomes
p_delivery_kind => 'function', with the same engine-guaranteedp_cooldown_minutes(anti-flap),p_run_sequenceordering, and exception isolation. The routine contract is now(p_notification_log_id bigint, p_evaluation_id bigint, p_args jsonb) RETURNS void, and it reports its own outcome withpghf.mark_notification_delivered()(replacinglog_action_result()). - Firings are journalled in the shared outbox
pghf.notification_log(replacingaction_log); prune withpghf.purge_notification_log_before(). - Unlike the old actions, a notification can also be category- or global-scoped, not just check-scoped.
See Notifications for the full reference, and Notifications in the User Guide for the narrative — including why on_state is the right vehicle for on-event checks (one notification per distinct occurrence).
Continue to Retention.