Skip to content

Commit

Permalink
using v2 alertmanager api for simulate alerts (#1631)
Browse files Browse the repository at this point in the history
v2 api is supported since 0.16 - year 2019 and it removed since 0.28 - year 2024
  • Loading branch information
Sheeproid authored Nov 17, 2024
1 parent fc3b062 commit 0dc25a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions playbooks/robusta_playbooks/prometheus_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0dc25a9

Please sign in to comment.