commit | aacc4a5b3af13ce23b749ab85ef55dca53b24158 | [log] [tgz] |
---|---|---|
author | Michal Kobus <mkobus@mirantis.com> | Fri Jan 18 12:21:10 2019 +0100 |
committer | Michal Kobus <mkobus@mirantis.com> | Fri Jan 18 12:21:10 2019 +0100 |
tree | 1bb2356730401ced2e178be38ba88a3ffa5c05f7 | |
parent | 7e9acee6bcd81c9588b04c407d763e7b8b02c066 [diff] |
Handle all Salesforce exceptions - respond to Alertmanager with HTTP 500 - log error message Change-Id: I0d01e17b7f797ff7881ebe08205601818abec64c Related-bug: PROD-26577 (PROD:26577)
Prometheus Alertmanager webhook receiver sending alert notification to Salesforce.
Install Python dependencies:
$ virtualenv venv $ venv/bin/pip install -e . $ source sf_notifier/vars/development
Add to settings/development.py
credentials for your Salesforce customer (not engineering) account:
SF_CONFIG = { 'AUTH_URL': 'xxx', 'USERNAME': 'xxx', 'PASSWORD': 'xxx', 'ORGANIZATION_ID': 'xxx', 'ENVIRONMENT_ID': 'xxx', 'SANDBOX_ENABLED': True }
You may also specify environment variables to override Python settings:
export SFDC_AUTH_URL="xxx" export SFDC_USERNAME="xxx" export SFDC_PASSWORD="xxx" export SFDC_ORGANIZATION_ID="xxx" export SFDC_ENVIRONMENT_ID="xxx" export SFDC_SANDBOX_ENABLED=true
Run server:
$ venv/bin/uwsgi --http 127.0.0.1:5000 --wsgi-file sf_notifier/server.py --callable app_dispatch
Check in browser:
http://127.0.0.1:5000/metrics