From bb33c1898f9965c0e3f3ba1fb6fcbe0f77b598d4 Mon Sep 17 00:00:00 2001 From: Jleee713 <97071690+Jleee713@users.noreply.github.com> Date: Mon, 25 May 2026 17:15:10 +1000 Subject: [PATCH] fix: parse site24x7 LABELS as dict for AlertDto compatibility (#6526) --- .../site24x7_provider/site24x7_provider.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/keep/providers/site24x7_provider/site24x7_provider.py b/keep/providers/site24x7_provider/site24x7_provider.py index ecfd296520..d6c52d4fa3 100644 --- a/keep/providers/site24x7_provider/site24x7_provider.py +++ b/keep/providers/site24x7_provider/site24x7_provider.py @@ -234,11 +234,20 @@ def _format_alert( elif not isinstance(tags, list): tags = [] - labels = event.get("LABELS", "") - if isinstance(labels, str) and labels: - labels = [lbl.strip() for lbl in labels.split(",") if lbl.strip()] - elif not isinstance(labels, list): - labels = [] + labels_raw = event.get("LABELS", "") + if isinstance(labels_raw, dict): + labels = labels_raw + elif isinstance(labels_raw, str) and labels_raw: + labels = {} + for part in labels_raw.split(","): + part = part.strip() + if ":" in part: + k, _, v = part.partition(":") + labels[k.strip()] = v.strip() + elif part: + labels[part] = "" + else: + labels = {} return AlertDto( url=event.get("MONITORURL", ""),