From 0dc25a9f2ab562a596b76a68a8555f974910d00d Mon Sep 17 00:00:00 2001 From: Tomer Date: Sun, 17 Nov 2024 11:19:56 +0200 Subject: [PATCH] using v2 alertmanager api for simulate alerts (#1631) v2 api is supported since 0.16 - year 2019 and it removed since 0.28 - year 2024 --- playbooks/robusta_playbooks/prometheus_simulation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/robusta_playbooks/prometheus_simulation.py b/playbooks/robusta_playbooks/prometheus_simulation.py index c69c71130..2be1becf0 100644 --- a/playbooks/robusta_playbooks/prometheus_simulation.py +++ b/playbooks/robusta_playbooks/prometheus_simulation.py @@ -219,10 +219,10 @@ def alertmanager_alert(event: ExecutionBaseEvent, action_params: AlertmanagerAle try: requests.post( - f"{alertmanager_url}/api/v1/alerts", + f"{alertmanager_url}/api/v2/alerts", data=json.dumps(alerts), headers=headers, - ) + ).raise_for_status() except Exception: logging.exception(f"Failed to create alertmanager alerts {alerts}") raise ActionException(ErrorCodes.ALERT_MANAGER_REQUEST_FAILED)