You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Summary
When using the prometheus plugin, I get an error, as mentionned in the title:
Error while running action plugin 'alerta_prometheus': name 'USE_AM_EXTERNALURL_FOR_SILENCES' is not defined (500)
The problem seem to be this:
the variable set is:
ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES = os.environ.get('ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES') or app.config.get('ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES',False)
but the plugin is looking for this:
# 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:
I tried to change the condition to ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES and it seem to work fine so far
Environment
OS: LLinux
API version: 8.6.5
Deployment: self-hosted
For self-hosted, WSGI environment: nginx/uwsgi
Database: MongoDB
Server config:
Auth enabled? Yes
Auth provider? Basic
Customer views? No
(or provide the /config endpoint output)
web UI version: 6.7.0
CLI version: na
To Reproduce
Steps to reproduce the behavior:
Go to the web ui
Try to ackonowledge an Alertmanager alert.
'
See error (include command output)
Traceback (most recent call last):
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/alerta/lib64/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/opt/alerta/lib64/python3.6/site-packages/alerta/auth/decorators.py", line 90, in wrapped
return f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/models/metrics.py", line 258, in wrapped
response = f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/utils/response.py", line 18, in decorated
return func(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/views/alerts.py", line 173, in action_alert
raise ApiError(str(e), 500)
Traceback (most recent call last):
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/alerta/lib64/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/opt/alerta/lib64/python3.6/site-packages/alerta/auth/decorators.py", line 90, in wrapped
return f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/models/metrics.py", line 258, in wrapped
response = f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/utils/response.py", line 18, in decorated
return func(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/views/alerts.py", line 173, in action_alert
raise ApiError(str(e), 500)
For web app issues, include any web browser JavaScript console errors.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
NOTE: Please provide as much information about your issue as possible.
Failure to provide basic details about your specific environment make
it impossible to know if an issue has already been fixed, can delay a
response and may result in your issue being closed without a resolution.
The text was updated successfully, but these errors were encountered:
NeilOrley
added a commit
to NeilOrley/alerta-contrib
that referenced
this issue
Jan 26, 2022
Issue Summary
When using the prometheus plugin, I get an error, as mentionned in the title:
Error while running action plugin 'alerta_prometheus': name 'USE_AM_EXTERNALURL_FOR_SILENCES' is not defined (500)
The problem seem to be this:
the variable set is:
ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES = os.environ.get('ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES') or app.config.get('ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES',False)
but the plugin is looking for this:
I tried to change the condition to ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES and it seem to work fine so far
Environment
OS: LLinux
API version: 8.6.5
Deployment: self-hosted
For self-hosted, WSGI environment: nginx/uwsgi
Database: MongoDB
Server config:
Auth enabled? Yes
Auth provider? Basic
Customer views? No
(or provide the
/config
endpoint output)web UI version: 6.7.0
CLI version: na
To Reproduce
Steps to reproduce the behavior:
'
Traceback (most recent call last):
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/alerta/lib64/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/opt/alerta/lib64/python3.6/site-packages/alerta/auth/decorators.py", line 90, in wrapped
return f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/models/metrics.py", line 258, in wrapped
response = f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/utils/response.py", line 18, in decorated
return func(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/views/alerts.py", line 173, in action_alert
raise ApiError(str(e), 500)
Traceback (most recent call last):
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/alerta/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/alerta/lib64/python3.6/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "/opt/alerta/lib64/python3.6/site-packages/alerta/auth/decorators.py", line 90, in wrapped
return f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/models/metrics.py", line 258, in wrapped
response = f(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/utils/response.py", line 18, in decorated
return func(*args, **kwargs)
File "/opt/alerta/lib64/python3.6/site-packages/alerta/views/alerts.py", line 173, in action_alert
raise ApiError(str(e), 500)
For web app issues, include any web browser JavaScript console errors.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
NOTE: Please provide as much information about your issue as possible.
Failure to provide basic details about your specific environment make
it impossible to know if an issue has already been fixed, can delay a
response and may result in your issue being closed without a resolution.
The text was updated successfully, but these errors were encountered: