Update alerta_prometheus.py ()

Resolves issue 'USE_AM_EXTERNALURL_FOR_SILENCES' is not defined : https://github.com/alerta/alerta-contrib/issues/379
This commit is contained in:
Neil Orley 2022-06-22 14:59:25 +02:00 committed by GitHub
parent 69d271ef9f
commit 64e013029d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,7 +127,7 @@ class AlertmanagerSilence(PluginBase):
# 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)