Skip to content

Allow setting a different priority for resolved ntfy notifications #1817

Description

@cad0p

Summary

The ntfy provider uses a single priority for both triggered and resolved messages: buildRequestBody in alerting/provider/ntfy/ntfy.go always sends cfg.Priority. Pushover supports a separate resolved-priority (#879, requested in #767); the same would be useful for ntfy.

Use case: a critical endpoint wants priority: 5 (max) when it fails, but the resolved message should be quiet (e.g. priority: 3) instead of bypassing DND a second time. Today the choices are repeating the trigger priority on resolve or setting send-on-resolved: false and getting no recovery notification at all.

Proposed configuration

alerting:
  ntfy:
    url: "https://ntfy.sh"
    topic: "..."
    priority: 5            # triggered
    resolved-priority: 3   # resolved; defaults to `priority` when unset

Proposal

  • Add resolved-priority (int, optional) to the ntfy Config, matching Pushover's field name (resolved-priority / ResolvedPriority).
  • When set, valid range is 1–5, same as priority; 0 means unset.
  • When unset, resolved messages use priority (not the provider default of 3), which keeps existing configs backward compatible.
  • Merge(): apply a non-zero override like the other fields, so group overrides and alert-level provider-override keep working.
  • buildRequestBody(): when resolved == true, send resolved-priority if set, otherwise fall back to priority.
  • Apply the fallback after overrides are merged, so an override that only sets priority also affects resolved messages when resolved-priority was never set.

Alternatives

The custom provider can express this today with the [ALERT_TRIGGERED_OR_RESOLVED] placeholder, but that requires hand-rolling the ntfy JSON payload instead of using the native provider.

Happy to open a PR if the approach looks right.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions