From c708d4e7beaf168f20ed5a4d8648d59be72c4a43 Mon Sep 17 00:00:00 2001 From: Vladimir Filonov Date: Fri, 13 Dec 2024 21:46:14 +0400 Subject: [PATCH] fix: Add default status and severity to prevent events failing (#2826) --- .../victoriametrics_provider/victoriametrics_provider.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keep/providers/victoriametrics_provider/victoriametrics_provider.py b/keep/providers/victoriametrics_provider/victoriametrics_provider.py index 075bd64d3..206ffbdda 100644 --- a/keep/providers/victoriametrics_provider/victoriametrics_provider.py +++ b/keep/providers/victoriametrics_provider/victoriametrics_provider.py @@ -205,10 +205,10 @@ def _format_alert( id=fingerprint, description=annotations.get("description"), message=annotations.get("summary"), - status=VictoriametricsProvider.STATUS_MAP[alert["status"]], - severity=VictoriametricsProvider.SEVERITIES_MAP[ - labels.get("severity", "low") - ], + status=VictoriametricsProvider.STATUS_MAP.get(alert["status"], AlertStatus.FIRING), + severity=VictoriametricsProvider.SEVERITIES_MAP.get( + labels.get("severity", "low"), AlertSeverity.LOW + ), startedAt=alert.get("startsAt"), url=alert.get("generatorURL"), source=["victoriametrics"],