From 31cad5cfd64c429e8a787f3e56a79482cce72e33 Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Wed, 26 Jan 2022 17:27:36 +0100 Subject: [PATCH] Update alerta_prometheus.py Resolves issue 'USE_AM_EXTERNALURL_FOR_SILENCES' is not defined : https://github.com/alerta/alerta-contrib/issues/379 --- plugins/prometheus/alerta_prometheus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/prometheus/alerta_prometheus.py b/plugins/prometheus/alerta_prometheus.py index 77703daf..cdcc1d40 100644 --- a/plugins/prometheus/alerta_prometheus.py +++ b/plugins/prometheus/alerta_prometheus.py @@ -127,7 +127,7 @@ def take_action(self, alert: Alert, action: str, text: str, **kwargs) -> Any: # if alertmanager is clustered behind a load balancer that mirrors requests we should prefer to create one silence # rather than many - if USE_AM_EXTERNALURL_FOR_SILENCES: + if ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES: base_url = alert.attributes.get('externalUrl', DEFAULT_ALERTMANAGER_API_URL) or ALERTMANAGER_API_URL else: base_url = ALERTMANAGER_API_URL or alert.attributes.get('externalUrl', DEFAULT_ALERTMANAGER_API_URL)