feat(bot): show actual response on failure, flap threshold, pause/rename/baseline, komodo fleet control and alert intake

This commit is contained in:
hh
2026-07-23 00:07:43 +02:00
parent a46bd92b4c
commit bf5e8d434e
18 changed files with 1279 additions and 89 deletions
+14
View File
@@ -20,6 +20,14 @@ class Service:
json_value: str | None
is_up: bool
created_at: str
# Сколько проверок подряд провалилось. Инцидент открывается, только когда
# счётчик дорастает до monitor.failure_threshold, — см. env.py.
fail_streak: int = 0
# Пауза: сервис остаётся в списке, но не пингуется и не будит ночью.
# Нужно на время плановых работ, чтобы не удалять сервис со статистикой.
is_paused: bool = False
last_latency_ms: int | None = None
last_checked_at: str | None = None
@property
def rule(self) -> str:
@@ -29,6 +37,12 @@ class Service:
return f"<code>{self.json_path}</code> = <code>{self.json_value}</code>"
return "тело ответа неизменно"
@property
def mark(self) -> str:
if self.is_paused:
return ""
return "🟢" if self.is_up else "🔴"
@dataclass(slots=True)
class Incident: