feat: RDG session flap rule, qwinsta/logoff queue and dashboard UI (0.9.13)

Detect 302→303 within 1–10s, Problem with 30s dedup, rdg_flap flag.
Agent command poll API, admin qwinsta/logoff from Overview. Migration 016.
This commit is contained in:
PTah
2026-06-19 23:34:01 +10:00
parent b328d32f97
commit 2aec488226
24 changed files with 1012 additions and 25 deletions
+6 -4
View File
@@ -1,6 +1,6 @@
"""Auto-create Problems from ingested events (rules + correlation)."""
from datetime import datetime, timezone
from datetime import datetime, timedelta, timezone
from sqlalchemy import select
from sqlalchemy.orm import Session
@@ -11,6 +11,7 @@ from app.services.host_health import HEARTBEAT_TYPE
from app.services.problem_rules import (
RuleMatch,
RULE_HOST_SILENCE,
RULE_RDG_SESSION_FLAP,
build_fingerprint,
pick_rule_match,
resolve_host_silence_problems,
@@ -18,8 +19,6 @@ from app.services.problem_rules import (
def _correlation_cutoff(now: datetime) -> datetime:
from datetime import timedelta
minutes = get_settings().sac_problem_correlation_window_minutes
return now - timedelta(minutes=minutes)
@@ -66,7 +65,10 @@ def open_or_append_problem(
match.fingerprint_suffix,
)
now = datetime.now(timezone.utc)
cutoff = _correlation_cutoff(now)
if match.rule_id == RULE_RDG_SESSION_FLAP:
cutoff = now - timedelta(seconds=get_settings().sac_rdg_flap_dedup_sec)
else:
cutoff = _correlation_cutoff(now)
open_problem = db.scalar(
select(Problem)