feat(alerts): a rule can fire when a reading rises, "rose by N" (#6724)
A rule compared a reading with a fixed number, so Synology Disk 1's bad sectors going from 3,160 to 3,392 could say nothing: a count that only grows is soon past any line. "rose by" compares each reading with the one before it, kept on the alert's state and only for such a rule. A fall (a replaced disk) doesn't fire. On the rule form, through MCP, and worded in emails, the alert sentence, history and the timeline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -224,6 +224,8 @@ def alert_facts(alert: dict, tz: tzinfo, show_utc: bool = True) -> dict:
|
||||
else _upper_first(f"{counted}{on} again.")
|
||||
elif counted:
|
||||
headline = _upper_first(f"{counted}{on}.")
|
||||
elif state == "resolved" and alert.get("operator") == "rose":
|
||||
headline = f"{metric_label(metric)}{on} has stopped rising" + (f", at {reading}." if reading else ".")
|
||||
elif state == "resolved":
|
||||
headline = f"{metric_label(metric)}{on} is back within its limit" + (
|
||||
f", at {reading}." if reading else ".")
|
||||
|
||||
Reference in New Issue
Block a user