commit | 211ee9243b80b86a9702563b81f72b196245ef1a | [log] [tgz] |
---|---|---|
author | Michal Kobus <mkobus@mirantis.com> | Mon Apr 15 17:44:06 2019 +0200 |
committer | Michal Kobus <mkobus@mirantis.com> | Wed Apr 24 11:03:51 2019 +0200 |
tree | d6d7f49240b033fbaedb1ccc41e72e52995523af | |
parent | 4104c10b575dbc9d3c0ad20ce4607ba42bc19a21 [diff] |
Reuse Salesforce session id - Session file - One worker at a time has ability to lock session file, auth and write new session id - Other workers waits and reuse the session id - Workers compare their session id with the one in file Change-Id: I371b0a7172a5b312a2ae2aef96d02505a1823f86 Related-bug: PROD-29347 (PROD:29347)
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