Skip to content

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 explicit p_severities => ARRAY['critical'] (or a p_min_severity floor). Want a different routine per severity result? Register one on_state notification per severity — ARRAY['critical'] → f_critical, ARRAY['ok'] → f_ok.
  • The inline function becomes p_delivery_kind => 'function', with the same engine-guaranteed p_cooldown_minutes (anti-flap), p_run_sequence ordering, 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 with pghf.mark_notification_delivered() (replacing log_action_result()).
  • Firings are journalled in the shared outbox pghf.notification_log (replacing action_log); prune with pghf.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.